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:
authorMichael Niedermayer <michaelni@gmx.at>2014-06-04 14:54:15 +0400
committerMichael Niedermayer <michaelni@gmx.at>2014-06-04 14:54:15 +0400
commitc7e54628e30acbe896f92c8b8d89ae63901834ff (patch)
tree67307ec7145d058d3267cbb47e4eccb6b23b6ba9 /libavformat/oggenc.c
parenta40c338a00a4e1c7f2cce189db0f406f85d5792a (diff)
parent95b7fa1729b93bbb3f4fb85a5c0cb53cf970c3c7 (diff)
Merge commit '95b7fa1729b93bbb3f4fb85a5c0cb53cf970c3c7'
* commit '95b7fa1729b93bbb3f4fb85a5c0cb53cf970c3c7': oggenc: Support flushing the muxer Conflicts: libavformat/version.h Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/oggenc.c')
-rw-r--r--libavformat/oggenc.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/libavformat/oggenc.c b/libavformat/oggenc.c
index bec3917a21..6c50fc3521 100644
--- a/libavformat/oggenc.c
+++ b/libavformat/oggenc.c
@@ -554,7 +554,7 @@ static int ogg_write_header(AVFormatContext *s)
return 0;
}
-static int ogg_write_packet(AVFormatContext *s, AVPacket *pkt)
+static int ogg_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
{
AVStream *st = s->streams[pkt->stream_index];
OGGStreamContext *oggstream = st->priv_data;
@@ -592,6 +592,23 @@ static int ogg_write_packet(AVFormatContext *s, AVPacket *pkt)
return 0;
}
+static int ogg_write_packet(AVFormatContext *s, AVPacket *pkt)
+{
+ int i;
+
+ if (pkt)
+ return ogg_write_packet_internal(s, pkt);
+
+ for (i = 0; i < s->nb_streams; i++) {
+ OGGStreamContext *oggstream = s->streams[i]->priv_data;
+ if (oggstream->page.segments_count)
+ ogg_buffer_page(s, oggstream);
+ }
+
+ ogg_write_pages(s, 2);
+ return 0;
+}
+
static int ogg_write_trailer(AVFormatContext *s)
{
int i;
@@ -647,7 +664,7 @@ AVOutputFormat ff_ogg_muxer = {
.write_header = ogg_write_header,
.write_packet = ogg_write_packet,
.write_trailer = ogg_write_trailer,
- .flags = AVFMT_TS_NEGATIVE,
+ .flags = AVFMT_TS_NEGATIVE | AVFMT_ALLOW_FLUSH,
.priv_class = &ogg_muxer_class,
};
#endif