libavformat: Add a flag for muxers that support write_packet(NULL) for flushing
Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
@@ -3135,7 +3135,15 @@ static int compute_pkt_fields2(AVFormatContext *s, AVStream *st, AVPacket *pkt){
|
||||
|
||||
int av_write_frame(AVFormatContext *s, AVPacket *pkt)
|
||||
{
|
||||
int ret = compute_pkt_fields2(s, s->streams[pkt->stream_index], pkt);
|
||||
int ret;
|
||||
|
||||
if (!pkt) {
|
||||
if (s->oformat->flags & AVFMT_ALLOW_FLUSH)
|
||||
return s->oformat->write_packet(s, pkt);
|
||||
return 1;
|
||||
}
|
||||
|
||||
ret = compute_pkt_fields2(s, s->streams[pkt->stream_index], pkt);
|
||||
|
||||
if(ret<0 && !(s->oformat->flags & AVFMT_NOTIMESTAMPS))
|
||||
return ret;
|
||||
|
Reference in New Issue
Block a user