summaryrefslogtreecommitdiff
path: root/libavformat/fifo.c
Commit message (Collapse)AuthorAge
* avformat: introduce AVFormatContext io_close2 which returns an intMarton Balint2021-12-12
| | | | | | | | | | | | | | | | | Otherwise there is no way to detect an error returned by avio_close() because ff_format_io_close cannot get the return value. Checking the return value of the close function is important in order to check if all data was successfully written and the underlying close() operation was successful. It can also be useful even for read mode because it can return any pending AVIOContext error, so the user don't have to manually check AVIOContext->error. In order to still support if the user overrides io_close, the generic code only uses io_close2 if io_close is either NULL or the default io_close callback. Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat/fifo: avoid repeated scaling of timestamps on failure and recoveryRyoji Gyoda2021-11-29
| | | | | | | | | | | | | | | | | | | If fifo_thread_recover() succeeds immediately after fifo_thread_dispatch_message() fails, the dts of the packet is scaled twice, causing cur_dts to be abnormally large and "Application provided invalid, non monotonically increasing dts to muxer in stream" to occur repeatedly. Steps to reproduce: 1. ffmpeg -f lavfi -i testsrc -c:v libx264 -map 0:v -flags +global_header -f fifo -fifo_format flv -attempt_recovery 1 -recover_any_error 1 rtmp://example.com/livekey 2. set a breakpoint on fifo_thread_recover 3. force disconnect from the rtmp server 4. wait for break 5. reconnect to the rtmp server 6. resume execution of ffmpeg Signed-off-by: Ryoji Gyoda <gy.cft4@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat: Avoid allocation for AVStreamInternalAndreas Rheinhardt2021-09-17
| | | | | | | | | | Do this by allocating AVStream together with the data that is currently in AVStreamInternal; or rather: Put AVStream at the beginning of a new structure called FFStream (which encompasses more than just the internal fields and is a proper context in its own right, hence the name) and remove AVStreamInternal altogether. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat/fifo: Free dict on av_dict_copy() failureAndreas Rheinhardt2021-08-06
| | | | | | | | av_dict_copy() puts the onus on the caller to clean up dst on failure; it can be nonempty if copying a later entry of src fails after having successfully copied an earlier entry. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
* avformat: move AVStream.{first,cur}_dts to AVStreamInternalJames Almer2021-06-09
| | | | | | They are private fields, no reason to have them exposed in a public header. Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/fifo: check for flushed packets and timeshiftMichael Niedermayer2021-05-18
| | | | | | | Fixes: CID1464151 Dereference after null check Reviewed-by: Marton Balint <cus@passwd.hu> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
* avformat: Constify all muxer/demuxersAndreas Rheinhardt2021-04-27
| | | | | | | This is possible now that the next-API is gone. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat: Constify the API wrt AV(In|Out)putFormatAndreas Rheinhardt2021-04-27
| | | | | | | Also constify AVProbeData. Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com> Signed-off-by: James Almer <jamrial@gmail.com>
* avformat/fifo: add timeshift option to delay outputMarton Balint2020-06-09
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* ffplay, avcodec, avformat: Don't initialize before av_packet_ref()Andreas Rheinhardt2020-03-28
| | | | | | | It already initializes the packet. Reviewed-by: Anton Khirnov <anton@khirnov.net> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
* avformat/fifo: use AV_OPT_TYPE_DICT for format_optsMarton Balint2020-01-01
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* lavf: Constify AVOutputFormat pointer.Carl Eugen Hoyos2019-03-20
|
* avformat: migrate to AVFormatContext->urlMarton Balint2018-01-28
| | | | Signed-off-by: Marton Balint <cus@passwd.hu>
* libavformat/fifo: Fix initialization of underlying AVFormatContextJan Sebechlebsky2017-07-19
| | | | | | | | | | | | | Muxers may want to directly access filename in stored in AVFormatContext. For example in case of RTSP, the filename (url) is used by the muxer to extract parameters of the connection. These muxers will fail when used with fifo pseudo-muxer. This commit fixes this issue by passing filename from AVFormatContext of fifo pseudo-muxer to all AVFormatContext(s) of underlying muxers during initialization. Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com>
* avformat/fifo: assert on disallowed message type and state combinationsMarton Balint2017-02-19
| | | | | | Fixes Coverity CID 1396277. Signed-off-by: Marton Balint <cus@passwd.hu>
* lavf/fifo: fix undefined behaviour in deinit when destroying mutexMarton Balint2016-11-13
| | | | | Reviewed-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
* avformat: Add fifo pseudo-muxerJan Sebechlebsky2016-08-22
Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>