summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 24db635)
raw | patch | inline | side by side (parent: 24db635)
author | Harinarayan Bhatta <harinarayan@ti.com> | |
Mon, 24 Aug 2015 11:04:05 +0000 (16:34 +0530) | ||
committer | Harinarayan Bhatta <harinarayan@ti.com> | |
Mon, 24 Aug 2015 11:04:05 +0000 (16:34 +0530) |
Fixes a failure in dual-decode case.
Signed-off-by: Harinarayan Bhatta <harinarayan@ti.com>
Signed-off-by: Harinarayan Bhatta <harinarayan@ti.com>
util/demux.c | patch | blob | history | |
util/demux.h | patch | blob | history | |
viddec3test.c | patch | blob | history |
diff --git a/util/demux.c b/util/demux.c
index fdd4b7705ab14e07dc625ddf9b13d1b274ae2efe..d739519eab2bbe11d76b9494d5a642762848f47a 100644 (file)
--- a/util/demux.c
+++ b/util/demux.c
#include "util.h"
char mpeg4head[45] = {0,0,0,0};
-extern int first_in_buff;
int get_esds_offset(const char *filename, struct demux *demux);
static AVFormatContext *
@@ -108,6 +107,7 @@ static struct demux * open_stream(const char * filename, int *width, int *height
demux->cc = cc;
demux->st = st;
demux->bsf = bsf;
+ demux->first_in_buff = 0;
return demux;
}
if (bufsize > size)
bufsize = size;
- if(first_in_buff == 1) {
+ if(demux->first_in_buff == 1) {
memcpy(input, demux->esds.data, demux->esds.length);
memcpy(input + demux->esds.length, buf, bufsize);
- first_in_buff =0;
+ demux->first_in_buff =0;
bufsize = bufsize + demux->esds.length;
}
else {
diff --git a/util/demux.h b/util/demux.h
index 07faf5ebab2c2a0ddadf9c963a570c640414a608..0d486d243e2729811f367b3b47ac00fa6d6189d2 100644 (file)
--- a/util/demux.h
+++ b/util/demux.h
AVCodecContext *cc;
AVBitStreamFilterContext *bsf;
struct ESdescriptor esds;
+/* Used for mpeg4 esds data copy */
+ int first_in_buff;
};
struct demux * demux_init(const char * filename, int *width, int *height);
int demux_read(struct demux *demux, char *input, int size);
diff --git a/viddec3test.c b/viddec3test.c
index 2fa33d754ada214607db52ea0bdbcce8cabb761d..e26321036df87b501b05b94dbad192ec2c3f309e 100644 (file)
--- a/viddec3test.c
+++ b/viddec3test.c
#include "util.h"
#include "demux.h"
-/* Used for mpeg4 esds data copy */
-int first_in_buff = 0;
-
/* Padding for width as per Codec Requirement (for h264) */
#define PADX 32
/* Padding for height as per Codec requirement (for h264)*/
"ivahd_h264dec", decoder->params);
}
else if (decoder->demux->cc->codec_id == CODEC_ID_MPEG4) {
- first_in_buff = 1;
+ decoder->demux->first_in_buff = 1;
decoder->codec = VIDDEC3_create(decoder->engine,
"ivahd_mpeg4dec", decoder->params);
}