lavf/segment: slightly simplify fail logic in seg_write_packet()
authorStefano Sabatini <stefasab@gmail.com>
Fri, 13 Jan 2012 23:19:59 +0000 (00:19 +0100)
committerStefano Sabatini <stefasab@gmail.com>
Tue, 3 Jul 2012 19:48:50 +0000 (21:48 +0200)
libavformat/segment.c

index 17ef20a..caa9a89 100644 (file)
@@ -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;
     }