Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Sebechlebsky <sebechlebskyjan@gmail.com>2016-07-12 00:27:51 +0300
committerMarton Balint <cus@passwd.hu>2016-07-16 02:28:11 +0300
commite144b86fa4c7e178f2a7a9436ac2a89a82b58b09 (patch)
tree54e024cf453546bbafd63e1789366d5a9123cdcc /libavformat/tee.c
parent3d7b5ad217e2643811f3042ef91de02f5543f221 (diff)
avformat/tee: Support flushing by writing NULL pkt
This will add support for flushing by writing NULL packet to the tee muxer, which propagates the action to slave muxers as expected. Signed-off-by: Jan Sebechlebsky <sebechlebskyjan@gmail.com> Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavformat/tee.c')
-rw-r--r--libavformat/tee.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/libavformat/tee.c b/libavformat/tee.c
index c276a37a28..e750752a84 100644
--- a/libavformat/tee.c
+++ b/libavformat/tee.c
@@ -520,6 +520,17 @@ static int tee_write_packet(AVFormatContext *avf, AVPacket *pkt)
if (!(avf2 = tee->slaves[i].avf))
continue;
+ /* Flush slave if pkt is NULL*/
+ if (!pkt) {
+ ret = av_interleaved_write_frame(avf2, NULL);
+ if (ret < 0) {
+ ret = tee_process_slave_failure(avf, i, ret);
+ if (!ret_all && ret < 0)
+ ret_all = ret;
+ }
+ continue;
+ }
+
s = pkt->stream_index;
s2 = tee->slaves[i].stream_map[s];
if (s2 < 0)
@@ -557,5 +568,5 @@ AVOutputFormat ff_tee_muxer = {
.write_trailer = tee_write_trailer,
.write_packet = tee_write_packet,
.priv_class = &tee_muxer_class,
- .flags = AVFMT_NOFILE,
+ .flags = AVFMT_NOFILE | AVFMT_ALLOW_FLUSH,
};