diff options
author | Stefano Sabatini <stefasab@gmail.com> | 2013-10-15 15:17:22 +0200 |
---|---|---|
committer | Stefano Sabatini <stefasab@gmail.com> | 2013-10-15 15:17:22 +0200 |
commit | 1120fd7852cb7c2d1fdc60db4901ce41062b0f20 (patch) | |
tree | dbcc1f4d4638dec61f4ea32c46271ad654479a9f | |
parent | 67e507e10e9776c2a16bfa44a285576df30c57ba (diff) | |
download | ffmpeg-1120fd7852cb7c2d1fdc60db4901ce41062b0f20.tar.gz |
lavf/segment: simplify logic and fix !=0 check on segment_end return value
A successfull return value can be > 0.
-rw-r--r-- | libavformat/segment.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/libavformat/segment.c b/libavformat/segment.c index f0225ddc24..05e29d427a 100644 --- a/libavformat/segment.c +++ b/libavformat/segment.c @@ -663,12 +663,10 @@ static int seg_write_packet(AVFormatContext *s, AVPacket *pkt) (pkt->pts != AV_NOPTS_VALUE && av_compare_ts(pkt->pts, st->time_base, end_pts-seg->time_delta, AV_TIME_BASE_Q) >= 0))) { - ret = segment_end(s, seg->individual_header_trailer, 0); - - if (!ret) - ret = segment_start(s, seg->individual_header_trailer); + if ((ret = segment_end(s, seg->individual_header_trailer, 0)) < 0) + goto fail; - if (ret) + if ((ret = segment_start(s, seg->individual_header_trailer)) < 0) goto fail; oc = seg->avf; |