[FFmpeg-cvslog] smoothstreamingenc: Properly return errors from ism_flush to the caller

Martin Storsjö git at videolan.org
Sun Oct 7 11:43:24 CEST 2012


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Sat Oct  6 02:33:06 2012 +0300| [5fa43f76aa717789d864c402a44d801dac9480df] | committer: Martin Storsjö

smoothstreamingenc: Properly return errors from ism_flush to the caller

Signed-off-by: Martin Storsjö <martin at martin.st>

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

 libavformat/smoothstreamingenc.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/libavformat/smoothstreamingenc.c b/libavformat/smoothstreamingenc.c
index 7ee640a..d86e87f 100644
--- a/libavformat/smoothstreamingenc.c
+++ b/libavformat/smoothstreamingenc.c
@@ -551,7 +551,8 @@ static int ism_flush(AVFormatContext *s, int final)
         }
     }
 
-    write_manifest(s, final);
+    if (ret >= 0)
+        ret = write_manifest(s, final);
     return ret;
 }
 
@@ -561,13 +562,15 @@ static int ism_write_packet(AVFormatContext *s, AVPacket *pkt)
     AVStream *st = s->streams[pkt->stream_index];
     OutputStream *os = &c->streams[pkt->stream_index];
     int64_t end_pts = (c->nb_fragments + 1) * c->min_frag_duration;
+    int ret;
 
     if ((!c->has_video || st->codec->codec_type == AVMEDIA_TYPE_VIDEO) &&
         av_compare_ts(pkt->pts, st->time_base,
                       end_pts, AV_TIME_BASE_Q) >= 0 &&
         pkt->flags & AV_PKT_FLAG_KEY && os->packets_written) {
 
-        ism_flush(s, 0);
+        if ((ret = ism_flush(s, 0)) < 0)
+            return ret;
         c->nb_fragments++;
     }
 



More information about the ffmpeg-cvslog mailing list