History

lavf: make av_interleave_packet() return meaningful error codes

Stefano Sabatini committed 15 years ago

Commit c5dcb3d1 parent 77f21ce1 file · +4 −3Browse files

Unified · Split

libavformat/utils.c+4−3
@@ -3091,6 +3091,7 @@ static int av_interleave_packet(AVFormatContext *s, AVPacket *out, AVPacket *in, · 3090 unmodified lines
30913091
30923092 int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt){
30933093 AVStream *st= s->streams[ pkt->stream_index];
3094+ int ret;
30943095
30953096 //FIXME/XXX/HACK drop zero sized packets
30963097 if(st->codec->codec_type == AVMEDIA_TYPE_AUDIO && pkt->size==0)
@@ -3098,11 +3099,11 @@ int av_interleaved_write_frame(AVFormatContext *s, AVPacket *pkt){ · 1 unmodified line
30983099
30993100 av_dlog(s, "av_interleaved_write_frame size:%d dts:%"PRId64" pts:%"PRId64"\n",
31003101 pkt->size, pkt->dts, pkt->pts);
3101− if(compute_pkt_fields2(s, st, pkt) < 0 && !(s->oformat->flags & AVFMT_NOTIMESTAMPS))
3102− return -1;
3102+ if((ret = compute_pkt_fields2(s, st, pkt)) < 0 && !(s->oformat->flags & AVFMT_NOTIMESTAMPS))
3103+ return ret;
31033104
31043105 if(pkt->dts == AV_NOPTS_VALUE && !(s->oformat->flags & AVFMT_NOTIMESTAMPS))
3105− return -1;
3106+ return AVERROR(EINVAL);
31063107
31073108 for(;;){
31083109 AVPacket opkt;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t