aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-08-26 01:29:40 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-08-26 01:29:40 +0200
commit876d1d796bd80c75e3e6a7a458e3143cfe5c9474 (patch)
tree949cc4c9120dc58512d84998adcb949d173cd9c0 /libavformat
parent7c4e4c6a0664bf668f4b7766a06f30096e0601f3 (diff)
parentf913eeea43078b3b9052efd8d8d29e7b29b39208 (diff)
downloadffmpeg-876d1d796bd80c75e3e6a7a458e3143cfe5c9474.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: vp6: partially propagate huffman tree building errors during coeff model parsing and fix misspelling mpeg12: propagate chunk decode errors and fix conditional indentation vc1: fix VC-1 Pulldown handling. VC1: Fix first/last row checks with slices mp4: Handle non-trivial ES Descriptors. vc1: properly zero coded_block[] edges on new slice entry. Conflicts: libavcodec/vc1dec.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/isom.c16
-rw-r--r--libavformat/isom.h1
-rw-r--r--libavformat/mov.c3
-rw-r--r--libavformat/mpegts.c3
4 files changed, 19 insertions, 4 deletions
diff --git a/libavformat/isom.c b/libavformat/isom.c
index 09ee23bdfd..7ab13f29c2 100644
--- a/libavformat/isom.c
+++ b/libavformat/isom.c
@@ -372,6 +372,22 @@ int ff_mp4_read_descr(AVFormatContext *fc, AVIOContext *pb, int *tag)
return len;
}
+void ff_mp4_parse_es_descr(AVIOContext *pb, int *es_id)
+{
+ int flags;
+ if (es_id) *es_id = avio_rb16(pb);
+ else avio_rb16(pb);
+ flags = avio_r8(pb);
+ if (flags & 0x80) //streamDependenceFlag
+ avio_rb16(pb);
+ if (flags & 0x40) { //URL_Flag
+ int len = avio_r8(pb);
+ avio_skip(pb, len);
+ }
+ if (flags & 0x20) //OCRstreamFlag
+ avio_rb16(pb);
+}
+
static const AVCodecTag mp4_audio_types[] = {
{ CODEC_ID_MP3ON4, AOT_PS }, /* old mp3on4 draft */
{ CODEC_ID_MP3ON4, AOT_L1 }, /* layer 1 */
diff --git a/libavformat/isom.h b/libavformat/isom.h
index 2b64486129..7fc2b546f8 100644
--- a/libavformat/isom.h
+++ b/libavformat/isom.h
@@ -146,6 +146,7 @@ typedef struct MOVContext {
int ff_mp4_read_descr_len(AVIOContext *pb);
int ff_mp4_read_descr(AVFormatContext *fc, AVIOContext *pb, int *tag);
int ff_mp4_read_dec_config_descr(AVFormatContext *fc, AVStream *st, AVIOContext *pb);
+void ff_mp4_parse_es_descr(AVIOContext *pb, int *es_id);
#define MP4IODescrTag 0x02
#define MP4ESDescrTag 0x03
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 96a99280e1..2663aa0221 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -478,8 +478,7 @@ int ff_mov_read_esds(AVFormatContext *fc, AVIOContext *pb, MOVAtom atom)
avio_rb32(pb); /* version + flags */
ff_mp4_read_descr(fc, pb, &tag);
if (tag == MP4ESDescrTag) {
- avio_rb16(pb); /* ID */
- avio_r8(pb); /* priority */
+ ff_mp4_parse_es_descr(pb, NULL);
} else
avio_rb16(pb); /* ID */
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 68e3a76817..2238bdc04f 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -898,9 +898,8 @@ static int mp4_read_iods(AVFormatContext *s, const uint8_t *buf, unsigned size,
avio_r8(&pb);
len = ff_mp4_read_descr(s, &pb, &tag);
if (tag == MP4ESDescrTag) {
- *es_id = avio_rb16(&pb); /* ES_ID */
+ ff_mp4_parse_es_descr(&pb, es_id);
av_dlog(s, "ES_ID %#x\n", *es_id);
- avio_r8(&pb); /* priority */
len = ff_mp4_read_descr(s, &pb, &tag);
if (tag == MP4DecConfigDescrTag) {
*dec_config_descr = av_malloc(len);