aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2012-01-14 00:19:59 +0100
committerStefano Sabatini <stefasab@gmail.com>2012-07-03 21:48:50 +0200
commita5af29336ab4d483f122215482b74a2f0043d125 (patch)
treee32ce14d689da6c0a6585e8f7999238ac1629c2d
parent4ad17bc76b70057dfebd5b0977d107546d700e0d (diff)
downloadffmpeg-a5af29336ab4d483f122215482b74a2f0043d125.tar.gz
lavf/segment: slightly simplify fail logic in seg_write_packet()
-rw-r--r--libavformat/segment.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/libavformat/segment.c b/libavformat/segment.c
index 17ef20a4bc..caa9a89844 100644
--- a/libavformat/segment.c
+++ b/libavformat/segment.c
@@ -213,12 +213,7 @@ static int seg_write_packet(AVFormatContext *s, AVPacket *pkt)
av_log(s, AV_LOG_DEBUG, "Next segment starts at %d %"PRId64"\n",
pkt->stream_index, pkt->pts);
- ret = segment_end(s);
-
- if (!ret)
- ret = segment_start(s);
-
- if (ret)
+ if ((ret = segment_end(s)) < 0 || (ret = segment_start(s)) < 0)
goto fail;
}