summaryrefslogtreecommitdiff
path: root/libavformat/flvdec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2012-02-01 02:08:23 +0100
committerMichael Niedermayer <michaelni@gmx.at>2012-02-01 02:36:09 +0100
commita369a6b85819890b21a87af3ce983ce533b7169b (patch)
tree838f9821dc09bd99b59ce4a2d8123d5fd6868b91 /libavformat/flvdec.c
parent0a3a69e8d77146b53a1112c715a78e7d293883b1 (diff)
parent52afc9716849e6fb6c2420674d790d374061c663 (diff)
Merge remote-tracking branch 'qatar/master'
* qatar/master: (29 commits) fate: add golomb-test golomb-test: K&R formatting cosmetics h264: Split h264-test off into a separate file - golomb-test.c. h264-test: cleanup: drop timer invocations, commented out code and other cruft h264-test: Remove unused DSP and AVCodec contexts and related init calls. adpcm: Add missing stdint.h #include to fix standalone header compilation. lavf: add functions for accessing the fourcc<->CodecID mapping tables. lavc: set AVCodecContext.codec in avcodec_get_context_defaults3(). lavc: make avcodec_close() work properly on unopened codecs. lavc: add avcodec_is_open(). lavf: rename AVInputFormat.value to raw_codec_id. lavf: remove the pointless value field from flv and iv8 lavc/lavf: remove unnecessary symbols from the symbol version script. lavc: reorder AVCodec fields. lavf: reorder AVInput/OutputFormat fields. mp3dec: Fix a heap-buffer-overflow adpcmenc: remove some unneeded casts adpcmenc: use int16_t and uint8_t instead of short and unsigned char. adpcmenc: fix adpcm_ms extradata allocation adpcmenc: return proper AVERROR codes instead of -1 ... Conflicts: doc/APIchanges libavcodec/Makefile libavcodec/adpcmenc.c libavcodec/avcodec.h libavcodec/h264.c libavcodec/libavcodec.v libavcodec/mpc7.c libavcodec/mpegaudiodec.c libavcodec/options.c libavformat/Makefile libavformat/avformat.h libavformat/flvdec.c libavformat/libavformat.v Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/flvdec.c')
-rw-r--r--libavformat/flvdec.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 1f1424e949..ffb84e9794 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -233,22 +233,18 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream, AVStream *vst
if(amf_get_string(ioc, str_val, sizeof(str_val)) < 0)
return -1;
break;
- case AMF_DATA_TYPE_OBJECT: {
- unsigned int keylen;
-
+ case AMF_DATA_TYPE_OBJECT:
if ((vstream || astream) && ioc->seekable && key && !strcmp(KEYFRAMES_TAG, key) && depth == 1)
if (parse_keyframes_index(s, ioc, vstream ? vstream : astream,
max_pos) < 0)
av_log(s, AV_LOG_ERROR, "Keyframe index parsing failed\n");
- while(avio_tell(ioc) < max_pos - 2 && (keylen = avio_rb16(ioc))) {
- avio_skip(ioc, keylen); //skip key string
- if(amf_parse_object(s, NULL, NULL, NULL, max_pos, depth + 1) < 0)
+ while (avio_tell(ioc) < max_pos - 2 && amf_get_string(ioc, str_val, sizeof(str_val)) > 0) {
+ if (amf_parse_object(s, astream, vstream, str_val, max_pos, depth + 1) < 0)
return -1; //if we couldn't skip, bomb out.
}
if(avio_r8(ioc) != AMF_END_OF_OBJECT)
return -1;
- }
break;
case AMF_DATA_TYPE_NULL:
case AMF_DATA_TYPE_UNDEFINED:
@@ -697,5 +693,4 @@ AVInputFormat ff_flv_demuxer = {
#endif
.read_close = flv_read_close,
.extensions = "flv",
- .value = CODEC_ID_FLV1,
};