[FFmpeg-cvslog] lavf: make av_interleave_packet() return meaningful error codes
Stefano Sabatini
git at videolan.org
Thu Mar 17 02:09:19 CET 2011
ffmpeg | branch: master | Stefano Sabatini <stefano.sabatini-lala at poste.it> | Tue Mar 15 13:03:03 2011 +0100| [c5dcb3d493a6bb73efeb8bfae24f5cc31908201f] | committer: Michael Niedermayer
lavf: make av_interleave_packet() return meaningful error codes
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=c5dcb3d493a6bb73efeb8bfae24f5cc31908201f
---
libavformat/utils.c | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/libavformat/utils.c b/libavformat/utils.c
index afd5966..4697373 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -3091,6 +3091,7 @@ static int av_interleave_packet(AVFormatContext *s, AVPacket *out, AVPacket *in,
int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt){
AVStream *st= s->streams[ pkt->stream_index];
+ int ret;
//FIXME/XXX/HACK drop zero sized packets
if(st->codec->codec_type == AVMEDIA_TYPE_AUDIO && pkt->size==0)
@@ -3098,11 +3099,11 @@ int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt){
av_dlog(s, "av_interleaved_write_frame size:%d dts:%"PRId64" pts:%"PRId64"\n",
pkt->size, pkt->dts, pkt->pts);
- if(compute_pkt_fields2(s, st, pkt) < 0 && !(s->oformat->flags & AVFMT_NOTIMESTAMPS))
- return -1;
+ if((ret = compute_pkt_fields2(s, st, pkt)) < 0 && !(s->oformat->flags & AVFMT_NOTIMESTAMPS))
+ return ret;
if(pkt->dts == AV_NOPTS_VALUE && !(s->oformat->flags & AVFMT_NOTIMESTAMPS))
- return -1;
+ return AVERROR(EINVAL);
for(;;){
AVPacket opkt;
More information about the ffmpeg-cvslog
mailing list