summaryrefslogtreecommitdiff
path: root/libavformat/mux.c
diff options
context:
space:
mode:
authorMatthieu Bouron <matthieu.bouron@stupeflix.com>2016-06-23 15:27:00 +0200
committerMatthieu Bouron <matthieu.bouron@stupeflix.com>2016-06-23 15:59:44 +0200
commit5d75e4667742c851e21dcd6ce70154834fb7d22b (patch)
treedf3d4f2710c3480d2e81e3556a4f6ef407a9f86a /libavformat/mux.c
parent55816c926955799de1ebb7e0a03a0ebb5ea95bcc (diff)
parentdb7968bff4851c2be79b15b2cb2ae747424d2fca (diff)
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.c9
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);