Skip to content

Commit c7e5462

Browse files
committed
Merge commit '95b7fa1729b93bbb3f4fb85a5c0cb53cf970c3c7'
* commit '95b7fa1729b93bbb3f4fb85a5c0cb53cf970c3c7': oggenc: Support flushing the muxer Conflicts: libavformat/version.h Merged-by: Michael Niedermayer <[email protected]>
2 parents a40c338 + 95b7fa1 commit c7e5462

File tree

2 files changed

+20
-3
lines changed

2 files changed

+20
-3
lines changed

libavformat/oggenc.c

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ static int ogg_write_header(AVFormatContext *s)
554554
return 0;
555555
}
556556

557-
static int ogg_write_packet(AVFormatContext *s, AVPacket *pkt)
557+
static int ogg_write_packet_internal(AVFormatContext *s, AVPacket *pkt)
558558
{
559559
AVStream *st = s->streams[pkt->stream_index];
560560
OGGStreamContext *oggstream = st->priv_data;
@@ -592,6 +592,23 @@ static int ogg_write_packet(AVFormatContext *s, AVPacket *pkt)
592592
return 0;
593593
}
594594

595+
static int ogg_write_packet(AVFormatContext *s, AVPacket *pkt)
596+
{
597+
int i;
598+
599+
if (pkt)
600+
return ogg_write_packet_internal(s, pkt);
601+
602+
for (i = 0; i < s->nb_streams; i++) {
603+
OGGStreamContext *oggstream = s->streams[i]->priv_data;
604+
if (oggstream->page.segments_count)
605+
ogg_buffer_page(s, oggstream);
606+
}
607+
608+
ogg_write_pages(s, 2);
609+
return 0;
610+
}
611+
595612
static int ogg_write_trailer(AVFormatContext *s)
596613
{
597614
int i;
@@ -647,7 +664,7 @@ AVOutputFormat ff_ogg_muxer = {
647664
.write_header = ogg_write_header,
648665
.write_packet = ogg_write_packet,
649666
.write_trailer = ogg_write_trailer,
650-
.flags = AVFMT_TS_NEGATIVE,
667+
.flags = AVFMT_TS_NEGATIVE | AVFMT_ALLOW_FLUSH,
651668
.priv_class = &ogg_muxer_class,
652669
};
653670
#endif

libavformat/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
#define LIBAVFORMAT_VERSION_MAJOR 55
3333
#define LIBAVFORMAT_VERSION_MINOR 42
34-
#define LIBAVFORMAT_VERSION_MICRO 100
34+
#define LIBAVFORMAT_VERSION_MICRO 101
3535

3636
#define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \
3737
LIBAVFORMAT_VERSION_MINOR, \

0 commit comments

Comments
 (0)