aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-01-01 18:07:24 +0100
committerMichael Niedermayer <michaelni@gmx.at>2015-01-01 18:37:50 +0100
commit1c983ee2c10ee75251678a596a8e07f62cbfcf53 (patch)
tree7f36c13ca5470741d9dbd9a1a1f5abd05aebb612
parenta6d59978a00e2406501bb9b2b91179e6af8a3b03 (diff)
downloadffmpeg-1c983ee2c10ee75251678a596a8e07f62cbfcf53.tar.gz
avformat/flvdec: do not inject dts=0 metadata packets which failed to be parsed into a new data stream
Such data streams (which then contain no other packets except the faulty one) confuse some user applications, like VLC Works around vlcticket 12389 Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit 322f0f5960a743cac47252d90a0f1ea7a025feff) Conflicts: libavformat/flvdec.c
-rw-r--r--libavformat/flvdec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index b11e3352c1..a0189b1548 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -541,13 +541,13 @@ static int flv_read_metabody(AVFormatContext *s, int64_t next_pos)
type = avio_r8(ioc);
if (type != AMF_DATA_TYPE_STRING ||
amf_get_string(ioc, buffer, sizeof(buffer)) < 0)
- return -1;
+ return 2;
if (!strcmp(buffer, "onTextData"))
return 1;
if (strcmp(buffer, "onMetaData"))
- return -1;
+ return 2;
// find the streams now so that amf_parse_object doesn't need to do
// the lookup every time it is called.
@@ -813,7 +813,7 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
stream_type=FLV_STREAM_TYPE_DATA;
if (size > 13 + 1 + 4 && dts == 0) { // Header-type metadata stuff
meta_pos = avio_tell(s->pb);
- if (flv_read_metabody(s, next) == 0) {
+ if (flv_read_metabody(s, next) <= 0) {
goto skip;
}
avio_seek(s->pb, meta_pos, SEEK_SET);