[FFmpeg-soc] [soc]: r4895 - concat/ffmpeg.c.diff

gkovacs subversion at mplayerhq.hu
Sun Aug 2 02:51:27 CEST 2009


Author: gkovacs
Date: Sun Aug  2 02:51:27 2009
New Revision: 4895

Log:
removed hackish goto in opt_input_file

Modified:
   concat/ffmpeg.c.diff

Modified: concat/ffmpeg.c.diff
==============================================================================
--- concat/ffmpeg.c.diff	Sat Aug  1 20:48:10 2009	(r4894)
+++ concat/ffmpeg.c.diff	Sun Aug  2 02:51:27 2009	(r4895)
@@ -1,5 +1,5 @@
 diff --git a/ffmpeg.c b/ffmpeg.c
-index e899180..580c0a6 100644
+index e899180..9f8be3e 100644
 --- a/ffmpeg.c
 +++ b/ffmpeg.c
 @@ -70,6 +70,8 @@
@@ -79,19 +79,24 @@ index e899180..580c0a6 100644
      AVFormatParameters params, *ap = &params;
      int err, i, ret, rfps, rfps_base;
      int64_t timestamp;
-+    char concatenate_video_files;
++    char concatenate_video_files = 0;
  
      if (!strcmp(filename, "-"))
          filename = "pipe:";
-@@ -2859,6 +2881,24 @@ static void opt_input_file(const char *filename)
-     using_stdin |= !strncmp(filename, "pipe:", 5) ||
-                     !strcmp(filename, "/dev/stdin");
+@@ -2886,12 +2908,28 @@ static void opt_input_file(const char *filename)
+     ic->subtitle_codec_id= find_codec_or_die(subtitle_codec_name, CODEC_TYPE_SUBTITLE, 0);
+     ic->flags |= AVFMT_FLAG_NONBLOCK;
  
+-    /* open the input file with generic libav function */
+-    err = av_open_input_file(&ic, filename, file_iformat, 0, ap);
+-    if (err < 0) {
+-        print_error(filename, err);
+-        av_exit(1);
++    err = 0;
 +    playlist_ctx = ff_playlist_from_encodedstring(filename, ',');
 +    if (playlist_ctx) {
 +        av_log(ic, AV_LOG_DEBUG, "Generating playlist from %s\n", filename);
 +        concatenate_video_files = 1;
-+        ic = avformat_alloc_context();
 +        av_strlcpy(ic->filename, filename, sizeof(ic->filename));
 +        ic->nb_streams = 2;
 +        ic->iformat = ff_concat_alloc_demuxer();
@@ -100,24 +105,19 @@ index e899180..580c0a6 100644
 +        ff_playlist_set_streams(ic);
 +        nb_input_files = 1;
 +        input_files[0] = ic;
-+        goto configcodecs;
-+    }
-+    else
-+        concatenate_video_files = 0;
-+
-     /* get default parameters from command line */
-     ic = avformat_alloc_context();
- 
-@@ -2925,6 +2965,8 @@ static void opt_input_file(const char *filename)
-         start_time = 0;
++    } else {
++        /* open the input file with generic libav function */
++        err = av_open_input_file(&ic, filename, file_iformat, 0, ap);
++        if (err < 0) {
++            print_error(filename, err);
++            av_exit(1);
++        }
      }
- 
-+    configcodecs:
 +
-     /* update the current parameters so that they match the one of the input stream */
-     for(i=0;i<ic->nb_streams;i++) {
-         AVCodecContext *enc = ic->streams[i]->codec;
-@@ -3000,6 +3042,8 @@ static void opt_input_file(const char *filename)
+     if(opt_programid) {
+         int i;
+         for(i=0; i<ic->nb_programs; i++)
+@@ -3000,6 +3038,8 @@ static void opt_input_file(const char *filename)
          dump_format(ic, nb_input_files, filename, 0);
  
      nb_input_files++;


More information about the FFmpeg-soc mailing list