Anton Khirnov
09ae7b81ea
flvdec: do not create any streams in read_header()
...
The current muxer behaviour is to create streams in read_header() based
on the audio/video presence flags, but fill in the stream parameters
later when we actually get some packets for them. This is rather shady,
since other demuxers set the stream parameters immediately when the
stream is created and do not touch the stream codec context after that.
Change the flv demuxer to behave in the same way as other similar
demuxers -- create the streams only when we get a packet for them.
9 years ago
Michael Niedermayer
ab7ff38052
avformat/flvdec: Fix left shift of 137 by 24 places cannot be represented in type int
...
Fixes: 3c857d4d90365731524716e6d051e43a/signal_sigsegv_7f4f59bcc29e_1386_20abd2c8e655cb9c75b24368e65fe3b1.flv
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Clément Bœsch
43ecec0f03
avformat: use AV_OPT_TYPE_BOOL in a bunch of places
9 years ago
Nicolas George
0bac7a436b
lavf/flvdec: use FFERROR_REDO instead of AVERROR(EAGAIN).
...
Fix trac ticket #5041 .
9 years ago
Hendrik Leppkes
c2f861ca42
Replace remaining occurances of av_free_packet with av_packet_unref
9 years ago
Michael Niedermayer
ce0834bdd6
avformat/flvdec: set broken_sizes for "metadatacreator : MEGA"
...
The 2nd size value is wrong for the sample file
Fixes: Ticket4903
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
f4585e666f
avformat/flvdec: Print stream type in case a new stream is discovered after the header
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
e34ba5ec53
avformat/flvdec: Remove dead loop
...
Fixes CID1325682
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
14f6c4356b
avformat/flvdec: accept sizes if they are off by 11
...
This error was produced by rtmproto.c, it is possibly such streams
where dumped, this commit is needed to support them
Fixes: z0e.flv
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Thierry Foucu
7f72f2d75e
libavformat/flvdec.c: free always the packet after a resync.
...
In case of resync, always free the packet, but retry only if the resync
did not get to the end of the file. Otherwise, there is a memory leak when the
last packet in the file is corrupted.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
e3cf978cdd
avformat/flvdec: Detect broken sizes (OBS 0.655b), disable resync for affected files
...
Fixes Ticket4867
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
cbbd906be6
avformat/flvdec: Check that sizes match and resync if not
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
3496a20bb9
avformat/flvdec: Change packet loop to return EAGAIN instead of looping until a valid packet is foud
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
5629143433
avformat/flvdec: Use the first index entry to find the first packet if there was a parsing error in the header
...
Fixes: unknow_codec.flv
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
fd6296e412
avformat/flvdec: Print last packet size at trace level
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Michael Niedermayer
6bed88ac78
avformat/flvdec: Print terminator value found if it differs from AMF_END_OF_OBJECT in AMF_DATA_TYPE_MIXEDARRAY
...
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
9 years ago
Vittorio Giovara
059a934806
lavc: Consistently prefix input buffer defines
...
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
10 years ago
Vittorio Giovara
a7ac1a7b94
flv: Name an enum and use its type
10 years ago
Igor Derzhavin
203f9c8ff0
libavformat/flvdec.c: don't build index_entries for input stream if AVIOContext is not seekable
...
Signed-off-by: Igor Derzhavin <igor.derzhavin@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Ganesh Ajjanagadde
a86928d2ab
flvdec: fix lack of duration for some files
...
Fixes #4579
Signed-off-by: Ganesh Ajjanagadde <gajjanagadde@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
108b738db1
avformat/flvdec: Show unknown tags at debug level
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
790a3cdf76
avformat/flvdec: Add TYPE_ONCAPTIONINFO
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
b2fecce3c1
avformat/flvdec: increase buffer size for parsing metadata string key
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Vittorio Giovara
1a3eb042c7
Replace av_dlog with normal av_log at trace level
...
This applies to every library where performance is not critical.
10 years ago
Michael Niedermayer
3727cd5416
avformat/flvdec: add support for OnCaption
10 years ago
Michael Niedermayer
1df64d6c46
avformat/flvdec: re enable flv_data_packet()
...
Found-by: kurosu
Reviewed-by: Andreas Cadhalpun <andreas.cadhalpun@googlemail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
7869b2959d
avformat/flvdec: Change subtitle stream type to subtitle type
...
Previous-version-reviewed-by: Andreas Cadhalpun
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Diego Biurrun
daf8cf358a
avformat: Don't anonymously typedef structs
10 years ago
Clément Bœsch
6a29499b95
avformat/flvdec: remove duplicated line error
...
Fix typo regression since 5c37ffca59
Found-By: cousin_luigi
10 years ago
Michael Niedermayer
efc4bfc195
avformat/flvdec: use named identifier instead of literal numbers as return values
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
eb767a276b
avformat/flvdec: Increase string array size
...
Fixes parsing httphostheader of Scarlatti\,\ Pieter-Jan\ Belder\ -\ Sonata\ K113\ in\ A\ major\ -\ Alle.flv
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
322f0f5960
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>
10 years ago
Michael Niedermayer
5c37ffca59
avformat/flvdec: add several error messages to error conditions
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
91ea466551
avformat/flvdec: Use av_freep() avoid leaving stale pointers in memory
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Michael Niedermayer
0fadbd3623
avformat/flvdec: fix potential use of uninitialized variables
...
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Uwe L. Korn
40665d27e3
flvdec: Document how the duration is retrieved at the end of the file
...
Signed-off-by: Martin Storsjö <martin@martin.st>
10 years ago
Vittorio Giovara
629b2ed0ac
flvdec: make sure to check create_stream and report the same error
...
CC: libav-stable@libav.org
Bug-Id: CID 732242
10 years ago
Vittorio Giovara
f22aa6b841
flvdec: avoid unitialized use of a struct member
...
CC: libav-stable@libav.org
Bug-Id: CID 718141
10 years ago
Steven Liu
03efd73082
avformat/flvdec: read the correct bits into the tag type
...
from the flv spec, the flvtag define the tagtype as one byte,
the spec desc is:
Reserved UB[2] Reserved for FMS, should be 0
Filter UB[1] Indicates if packets are filtered.
0 = No pre-processing required.
1 = Pre-processing (such as decryption) of the packet is
required before it can be rendered.
Shall be 0 in unencrypted files, and 1 for encrypted
tags.
See Annex F. FLV Encryption for the use of filters.
TagType UB[5] Type of contents in this tag. The following types are
defined:
8 = audio
9 = video
18 = script data
Signed-off-by: Steven Liu <qi.liu@chinacache.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
10 years ago
Andrew Stone
0f789322ef
flvdec: update AVFormatContext.event_flags with METADATA_UPDATED whenever metadata changes.
...
Signed-off-by: Anton Khirnov <anton@khirnov.net>
11 years ago
Andrew Stone
93c04e095d
Expose metadata found in onCuePoint events in .flv files.
...
Currently, only onMetaData is used, but some providers (wrongly)
put metadata into onCuePoint events, and it's still nice to be
able to use that data.
onCuePoint events also present metadata slightly differently than
onMetaData events: all metadata is found inside an object called
"parameters". In order to extract this metadata, it's easiest to
recurse through the object tree and pull out anything found in
child objects and put it in the top-level metadata.
Reference: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/2/help.html?content=00001404.html
Signed-off-by: Anton Khirnov <anton@khirnov.net>
11 years ago
James Almer
d34ec64a22
replace calls to url_feof() with avio_feof()
...
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Luca Barbato
fa14804c83
flv: Index the audio stream
...
And leverage the video index if the video is just disabled as wm4
did in an initial patch.
11 years ago
Michael Niedermayer
01b236b704
avformat/flvdec: use AV_PKT_DATA_NEW_EXTRADATA for h264 too
...
Fixes Ticket 3787
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
dc5972f886
avformat/flvdec: give live_flvdec a separate name
...
This should fix a infinite loop on freebsd
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Michael Niedermayer
2fbdfba0f2
avformat/flvdec: Support live flv / NGINX RTMP streams
...
Fixes Ticket3553
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Uwe L. Korn
a1859032e3
flvdec: Do not default to a video and audio stream
...
If no streams were indicated in the FLV header, do not automatically
allocate by default a video and an audio stream. Instead, in the case
that the header did not indicate the presence of any data, allocate no
stream until data actually arrives for one type.
Signed-off-by: Martin Storsjö <martin@martin.st>
11 years ago
Michael Niedermayer
e9ad121ba5
Fix skiping typos
...
Found-by: Alessandro Ghedini <alessandro@ghedini.me>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
11 years ago
Luca Barbato
152b797cd6
flv: Do not mangle dts values for negative cts
...
Some applications really mean to send negative pts.
11 years ago
Luca Barbato
5d983fdbca
flv: Warn only once
...
No point in sending the message multiple time.
11 years ago