diff options
author | Atli Thorbjornsson <atlithorn@gmail.com> | 2013-06-06 00:09:20 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-06-07 11:11:59 +0200 |
commit | f3c51215cef3add584a9e939476baf1f07ab56a9 (patch) | |
tree | fc88c459602a45ec2f28889f69ed2da2a71eff55 | |
parent | 9c9d2e9c77935e381accc160442c3e6f3308d682 (diff) | |
download | ffmpeg-streaming-f3c51215cef3add584a9e939476baf1f07ab56a9.zip ffmpeg-streaming-f3c51215cef3add584a9e939476baf1f07ab56a9.tar.gz |
flvdec: Fix mistakenly discarding metadata at dts==0
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/flvdec.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c index 8bb56e8..d13238f 100644 --- a/libavformat/flvdec.c +++ b/libavformat/flvdec.c @@ -653,7 +653,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt) FLVContext *flv = s->priv_data; int ret, i, type, size, flags; int stream_type=-1; - int64_t next, pos; + int64_t next, pos, meta_pos; int64_t dts, pts = AV_NOPTS_VALUE; int av_uninit(channels); int av_uninit(sample_rate); @@ -703,13 +703,13 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt) if ((flags & FLV_VIDEO_FRAMETYPE_MASK) == FLV_FRAME_VIDEO_INFO_CMD) goto skip; } else if (type == FLV_TAG_TYPE_META) { + stream_type=FLV_STREAM_TYPE_DATA; if (size > 13+1+4 && dts == 0) { // Header-type metadata stuff - flv_read_metabody(s, next); - goto skip; - } else if (dts != 0) { // Script-data "special" metadata frames - don't skip - stream_type=FLV_STREAM_TYPE_DATA; - } else { - goto skip; + meta_pos = avio_tell(s->pb); + if (flv_read_metabody(s, next) == 0){ + goto skip; + } + avio_seek(s->pb, meta_pos, SEEK_SET); } } else { av_log(s, AV_LOG_DEBUG, "skipping flv packet: type %d, size %d, flags %d\n", type, size, flags); |