diff options
author | Matthieu Bouron <matthieu.bouron@stupeflix.com> | 2016-06-23 15:27:00 +0200 |
---|---|---|
committer | Matthieu Bouron <matthieu.bouron@stupeflix.com> | 2016-06-23 15:59:44 +0200 |
commit | 5d75e4667742c851e21dcd6ce70154834fb7d22b (patch) | |
tree | df3d4f2710c3480d2e81e3556a4f6ef407a9f86a /libavformat/mux.c | |
parent | 55816c926955799de1ebb7e0a03a0ebb5ea95bcc (diff) | |
parent | db7968bff4851c2be79b15b2cb2ae747424d2fca (diff) | |
download | ffmpeg-5d75e4667742c851e21dcd6ce70154834fb7d22b.tar.gz |
Merge commit 'db7968bff4851c2be79b15b2cb2ae747424d2fca'
* commit 'db7968bff4851c2be79b15b2cb2ae747424d2fca':
avio: Allow custom IO users to get labels for the output bytestream
Merged-by: Matthieu Bouron <matthieu.bouron@stupeflix.com>
Diffstat (limited to 'libavformat/mux.c')
-rw-r--r-- | libavformat/mux.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libavformat/mux.c b/libavformat/mux.c index 76db60752f..8488043006 100644 --- a/libavformat/mux.c +++ b/libavformat/mux.c @@ -475,6 +475,8 @@ static int init_pts(AVFormatContext *s) static int write_header_internal(AVFormatContext *s) { + if (!(s->oformat->flags & AVFMT_NOFILE) && s->pb) + avio_write_marker(s->pb, AV_NOPTS_VALUE, AVIO_DATA_MARKER_HEADER); if (s->oformat->write_header) { int ret = s->oformat->write_header(s); if (ret >= 0 && s->pb && s->pb->error < 0) @@ -486,6 +488,8 @@ static int write_header_internal(AVFormatContext *s) avio_flush(s->pb); } s->internal->header_written = 1; + if (!(s->oformat->flags & AVFMT_NOFILE) && s->pb) + avio_write_marker(s->pb, AV_NOPTS_VALUE, AVIO_DATA_MARKER_UNKNOWN); return 0; } @@ -1164,12 +1168,15 @@ int av_write_trailer(AVFormatContext *s) } fail: - if (s->internal->header_written && s->oformat->write_trailer) + if (s->internal->header_written && s->oformat->write_trailer) { + if (!(s->oformat->flags & AVFMT_NOFILE) && s->pb) + avio_write_marker(s->pb, AV_NOPTS_VALUE, AVIO_DATA_MARKER_TRAILER); if (ret >= 0) { ret = s->oformat->write_trailer(s); } else { s->oformat->write_trailer(s); } + } if (s->oformat->deinit) s->oformat->deinit(s); |