[FFmpeg-soc] [soc]: r5194 - in concat/libavformat: playlist.c utils.c.diff

gkovacs subversion at mplayerhq.hu
Thu Aug 20 15:49:02 CEST 2009


Author: gkovacs
Date: Thu Aug 20 15:49:02 2009
New Revision: 5194

Log:
have av_open_input_file use ff_playlist_formatcontext_from_filelist

Modified:
   concat/libavformat/playlist.c
   concat/libavformat/utils.c.diff

Modified: concat/libavformat/playlist.c
==============================================================================
--- concat/libavformat/playlist.c	Thu Aug 20 15:01:59 2009	(r5193)
+++ concat/libavformat/playlist.c	Thu Aug 20 15:49:02 2009	(r5194)
@@ -105,11 +105,9 @@ AVFormatContext *ff_playlist_formatconte
         av_log(NULL, AV_LOG_ERROR, "failed to create PlaylistContext in ff_playlist_formatcontext_from_filelist\n");
         return NULL;
     }
-    avformat_alloc_context();
+    ic = avformat_alloc_context();
     ic->iformat = ff_concat_alloc_demuxer();
     ic->priv_data = ctx;
-    ff_playlist_populate_context(ctx, ctx->pe_curidx);
-    ff_playlist_set_streams(ic);
     return ic;
 }
 

Modified: concat/libavformat/utils.c.diff
==============================================================================
--- concat/libavformat/utils.c.diff	Thu Aug 20 15:01:59 2009	(r5193)
+++ concat/libavformat/utils.c.diff	Thu Aug 20 15:49:02 2009	(r5194)
@@ -1,5 +1,5 @@
 diff --git a/libavformat/utils.c b/libavformat/utils.c
-index b9f6c00..86a710c 100644
+index b9f6c00..caa6c68 100644
 --- a/libavformat/utils.c
 +++ b/libavformat/utils.c
 @@ -27,6 +27,7 @@
@@ -10,37 +10,34 @@ index b9f6c00..86a710c 100644
  
  #undef NDEBUG
  #include <assert.h>
-@@ -433,6 +434,7 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
+@@ -432,7 +433,8 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
+                        int buf_size,
                         AVFormatParameters *ap)
  {
-     int err, probe_size;
-+    PlaylistContext *playlist_ctx;
+-    int err, probe_size;
++    int err, probe_size, flist_len;
++    char **flist;
      AVProbeData probe_data, *pd = &probe_data;
      ByteIOContext *pb = NULL;
  
-@@ -447,6 +449,27 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
+@@ -447,6 +449,22 @@ int av_open_input_file(AVFormatContext **ic_ptr, const char *filename,
          fmt = av_probe_input_format(pd, 0);
      }
  
-+    playlist_ctx = ff_playlist_from_encodedstring(filename, ',');
-+    if (playlist_ctx) {
-+        AVFormatContext *ic;
-+        AVFormatParameters default_ap;
-+        if(!ap){
-+            ap=&default_ap;
-+            memset(ap, 0, sizeof(default_ap));
++    ff_playlist_split_encodedstring(filename, ',', &flist, &flist_len);
++    if (flist && flist_len > 1) {
++        AVFormatContext *ic = ff_playlist_formatcontext_from_filelist(flist, flist_len);
++        if (ic) {
++            PlaylistContext *playlist_ctx = ff_playlist_get_context(ic);
++            if (playlist_ctx) {
++                av_log(ic, AV_LOG_DEBUG, "Generating playlist from %s\n", filename);
++                av_strlcpy(ic->filename, filename, sizeof(ic->filename));
++                ff_playlist_populate_context(playlist_ctx, playlist_ctx->pe_curidx);
++                ff_playlist_set_streams(ic);
++                *ic_ptr = ic;
++                return 0;
++            }
 +        }
-+        if(!ap->prealloced_context)
-+            ic = *ic_ptr = avformat_alloc_context();
-+        else
-+            ic = *ic_ptr;
-+        av_log(ic, AV_LOG_DEBUG, "Generating playlist from %s\n", filename);
-+        av_strlcpy(ic->filename, filename, sizeof(ic->filename));
-+        ic->iformat = ff_concat_alloc_demuxer();
-+        ic->priv_data = playlist_ctx;
-+        ff_playlist_populate_context(playlist_ctx, playlist_ctx->pe_curidx);
-+        ff_playlist_set_streams(ic);
-+        return 0;
 +    }
 +
      /* Do not open file if the format does not need it. XXX: specific


More information about the FFmpeg-soc mailing list