Merge commit '596e5d4783ca951258a7c580951fd161f1785ec1'

* commit '596e5d4783ca951258a7c580951fd161f1785ec1':
  lavf: Add a flag to enable/disable per-packet flushing

Conflicts:
	libavformat/avformat.h
	libavformat/mux.c
	libavformat/version.h

This adds a 2nd API to set per packet flushing
If the user application indicates through either a non default then this non default takes
precedence over the other still default value

Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer
2013-09-17 12:01:35 +02:00
4 changed files with 9 additions and 4 deletions

View File

@@ -535,10 +535,13 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
did_split = av_packet_split_side_data(pkt);
ret = s->oformat->write_packet(s, pkt);
if (s->flush_packets && s->pb && s->pb->error >= 0)
if (s->flush_packets && s->pb && ret >= 0 && s->flags & AVFMT_FLAG_FLUSH_PACKETS)
avio_flush(s->pb);
if (did_split)
av_packet_merge_side_data(pkt);
return ret;
}