[FFmpeg-cvslog] avformat/hlsenc: more robust error tests

Michael Niedermayer git at videolan.org
Sun Jan 11 05:39:04 CET 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Jan 11 04:58:29 2015 +0100| [aa6545e1f30e6f0aa7ad7498f524190b978b4e02] | committer: Michael Niedermayer

avformat/hlsenc: more robust error tests

errors are negative throughout ffmpeg

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=aa6545e1f30e6f0aa7ad7498f524190b978b4e02
---

 libavformat/hlsenc.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index a76dbce..29bf30e 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -395,7 +395,7 @@ static int hls_write_header(AVFormatContext *s)
 fail:
 
     av_dict_free(&options);
-    if (ret) {
+    if (ret < 0) {
         av_freep(&hls->basename);
         if (hls->avf)
             avformat_free_context(hls->avf);
@@ -438,7 +438,7 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
         hls->size = new_start_pos - hls->start_pos;
         ret = hls_append_segment(hls, hls->duration, hls->start_pos, hls->size);
         hls->start_pos = new_start_pos;
-        if (ret)
+        if (ret < 0)
             return ret;
 
         hls->end_pts = pkt->pts;
@@ -454,7 +454,7 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
             ret = hls_start(s);
         }
 
-        if (ret)
+        if (ret < 0)
             return ret;
 
         oc = hls->avf;



More information about the ffmpeg-cvslog mailing list