[FFmpeg-soc] [soc]: r5245 - concat/libavformat/concatgen.c

gkovacs subversion at mplayerhq.hu
Mon Aug 24 09:07:30 CEST 2009


Author: gkovacs
Date: Mon Aug 24 09:07:30 2009
New Revision: 5245

Log:
check for av_playlist_populate_context failure

Modified:
   concat/libavformat/concatgen.c

Modified: concat/libavformat/concatgen.c
==============================================================================
--- concat/libavformat/concatgen.c	Mon Aug 24 09:00:37 2009	(r5244)
+++ concat/libavformat/concatgen.c	Mon Aug 24 09:07:30 2009	(r5245)
@@ -78,7 +78,10 @@ int ff_concatgen_read_packet(AVFormatCon
                 ctx->pe_curidx = av_playlist_stream_index_from_time(ctx,
                                                                     av_playlist_time_offset(ctx->durations, ctx->pe_curidx),
                                                                     NULL);
-                av_playlist_populate_context(ctx, ctx->pe_curidx);
+                if (av_playlist_populate_context(ctx, ctx->pe_curidx) < 0) {
+                    av_log(NULL, AV_LOG_ERROR, "Failed to switch to AVFormatContext %d\n", ctx->pe_curidx);
+                    break;
+                }
                 av_playlist_set_streams(s);
                 // have_switched_streams is set to avoid infinite loop
                 have_switched_streams = 1;
@@ -101,7 +104,7 @@ int ff_concatgen_read_seek(AVFormatConte
                            int64_t pts,
                            int flags)
 {
-    int i;
+    int i, err;
     int64_t localpts_avtimebase, localpts, pts_avtimebase;
     AVPlaylistContext *ctx;
     AVFormatContext *ic;
@@ -114,7 +117,11 @@ int ff_concatgen_read_seek(AVFormatConte
     ctx->pe_curidx = av_playlist_stream_index_from_time(ctx,
                                                         pts_avtimebase,
                                                         &localpts_avtimebase);
-    av_playlist_populate_context(ctx, ctx->pe_curidx);
+    err = av_playlist_populate_context(ctx, ctx->pe_curidx);
+    if (err < 0) {
+        av_log(NULL, AV_LOG_ERROR, "Failed to switch to AVFormatContext %d\n", ctx->pe_curidx);
+        return err;
+    }
     av_playlist_set_streams(s);
     ic = ctx->formatcontext_list[ctx->pe_curidx];
     localpts = av_rescale_q(localpts_avtimebase,


More information about the FFmpeg-soc mailing list