mirror of https://git.ffmpeg.org/ffmpeg.git
allow NULL write_header() and write_trailer()
Originally committed as revision 4675 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
ed57bb79e8
commit
31e11451f7
|
@ -2253,9 +2253,11 @@ int av_write_header(AVFormatContext *s)
|
|||
}
|
||||
}
|
||||
|
||||
ret = s->oformat->write_header(s);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
if(s->oformat->write_header){
|
||||
ret = s->oformat->write_header(s);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* init PTS generation */
|
||||
for(i=0;i<s->nb_streams;i++) {
|
||||
|
@ -2540,7 +2542,8 @@ int av_write_trailer(AVFormatContext *s)
|
|||
goto fail;
|
||||
}
|
||||
|
||||
ret = s->oformat->write_trailer(s);
|
||||
if(s->oformat->write_trailer)
|
||||
ret = s->oformat->write_trailer(s);
|
||||
fail:
|
||||
if(ret == 0)
|
||||
ret=url_ferror(&s->pb);
|
||||
|
|
Loading…
Reference in New Issue