[FFmpeg-devel] [PATCH] lavf/segment: slightly simplify fail logic in seg_write_packet()
Stefano Sabatini
stefasab at gmail.com
Fri Jun 29 17:19:00 CEST 2012
---
libavformat/segment.c | 7 +------
1 files changed, 1 insertions(+), 6 deletions(-)
diff --git a/libavformat/segment.c b/libavformat/segment.c
index f1a9cdf..e1fcc3e 100644
--- a/libavformat/segment.c
+++ b/libavformat/segment.c
@@ -214,12 +214,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;
seg->start_time = (double)pkt->pts * av_q2d(st->time_base);
} else if (pkt->pts != AV_NOPTS_VALUE) {
--
1.7.5.4
More information about the ffmpeg-devel
mailing list