mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-06 07:40:00 +08:00
write error handling
Originally committed as revision 3572 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
@ -1996,11 +1996,16 @@ static void truncate_ts(AVStream *st, AVPacket *pkt){
|
||||
*/
|
||||
int av_write_frame(AVFormatContext *s, AVPacket *pkt)
|
||||
{
|
||||
int ret;
|
||||
|
||||
compute_pkt_fields2(s->streams[pkt->stream_index], pkt);
|
||||
|
||||
truncate_ts(s->streams[pkt->stream_index], pkt);
|
||||
|
||||
return s->oformat->write_packet(s, pkt);
|
||||
ret= s->oformat->write_packet(s, pkt);
|
||||
if(!ret)
|
||||
ret= url_ferror(&s->pb);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -2111,6 +2116,8 @@ int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt){
|
||||
|
||||
if(ret<0)
|
||||
return ret;
|
||||
if(url_ferror(&s->pb))
|
||||
return url_ferror(&s->pb);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2139,10 +2146,14 @@ int av_write_trailer(AVFormatContext *s)
|
||||
|
||||
if(ret<0)
|
||||
goto fail;
|
||||
if(url_ferror(&s->pb))
|
||||
goto fail;
|
||||
}
|
||||
|
||||
ret = s->oformat->write_trailer(s);
|
||||
fail:
|
||||
if(ret == 0)
|
||||
ret=url_ferror(&s->pb);
|
||||
for(i=0;i<s->nb_streams;i++)
|
||||
av_freep(&s->streams[i]->priv_data);
|
||||
av_freep(&s->priv_data);
|
||||
|
Reference in New Issue
Block a user