[FFmpeg-soc] [soc]: r2060 - libavfilter/diffs/04_ffmpeg_filters.diff

vitor subversion at mplayerhq.hu
Sun Mar 30 13:30:37 CEST 2008


Author: vitor
Date: Sun Mar 30 13:30:37 2008
New Revision: 2060

Log:
Fix filtering when copying to two output files, for ex:

ffmpeg -i file1.avi -vfilters vflip out1.avi out2.avi

Patch by Mike Sullivan (mike <at> affinesystems.com)


Modified:
   libavfilter/diffs/04_ffmpeg_filters.diff

Modified: libavfilter/diffs/04_ffmpeg_filters.diff
==============================================================================
--- libavfilter/diffs/04_ffmpeg_filters.diff	(original)
+++ libavfilter/diffs/04_ffmpeg_filters.diff	Sun Mar 30 13:30:37 2008
@@ -344,31 +344,42 @@ Index: ffmpeg.c
          // preprocess audio (volume)
          if (ist->st->codec->codec_type == CODEC_TYPE_AUDIO) {
              if (audio_volume != 256) {
-@@ -1227,10 +1507,23 @@
+@@ -1205,6 +1485,11 @@
+         /* if output time reached then transcode raw format,
+            encode packets and output them */
+         if (start_time == 0 || ist->pts >= start_time)
++#if ENABLE_AVFILTER
++        while(ist->st->codec->codec_type == CODEC_TYPE_VIDEO &&
++              avfilter_poll_frame(ist->out_video_filter->inputs[0])) {
++            get_filtered_video_pic(ist->out_video_filter, &ist->picref, &picture, &ist->pts);
++#endif
+             for(i=0;i<nb_ostreams;i++) {
+                 int frame_size;
+ 
+@@ -1227,6 +1512,9 @@
                              do_audio_out(os, ost, ist, data_buf, data_size);
                              break;
                          case CODEC_TYPE_VIDEO:
 +#if ENABLE_AVFILTER
-+                            while(avfilter_poll_frame(ist->out_video_filter->inputs[0])) {
-+                                get_filtered_video_pic(ist->out_video_filter, &ist->picref, &picture, &ist->pts);
-+                                ost->st->codec->sample_aspect_ratio = ist->picref->pixel_aspect;
-+                                do_video_out(os, ost, ist, &picture, &frame_size);
-+                                video_size += frame_size;
-+                                if (vstats_filename && frame_size)
-+                                    do_video_stats(os, ost, frame_size);
-+                                if(ist->picref)
-+                                    avfilter_unref_pic(ist->picref);
-+                            }
-+#else
++                            ost->st->codec->sample_aspect_ratio = ist->picref->pixel_aspect;
++#endif
                              do_video_out(os, ost, ist, &picture, &frame_size);
                              video_size += frame_size;
                              if (vstats_filename && frame_size)
-                                 do_video_stats(os, ost, frame_size);
+@@ -1286,6 +1574,12 @@
+                     }
+                 }
+             }
++
++#if ENABLE_AVFILTER
++            if(ist->picref)
++                avfilter_unref_pic(ist->picref);
++        }
 +#endif
-                             break;
-                         case CODEC_TYPE_SUBTITLE:
-                             do_subtitle_out(os, ost, ist, &subtitle,
-@@ -1693,10 +1986,21 @@
+         av_free(buffer_to_free);
+         /* XXX: allocate the subtitles in the codec ? */
+         if (subtitle_to_free) {
+@@ -1693,10 +1987,21 @@
                          fprintf(stderr, "Cannot get resampling context\n");
                          exit(1);
                      }
@@ -390,7 +401,7 @@ Index: ffmpeg.c
                  break;
              case CODEC_TYPE_SUBTITLE:
                  ost->encoding_needed = 1;
-@@ -3804,6 +4108,9 @@
+@@ -3804,6 +4109,9 @@
  #ifdef CONFIG_VHOOK
      { "vhook", HAS_ARG | OPT_EXPERT | OPT_VIDEO, {(void*)add_frame_hooker}, "insert video processing module", "module" },
  #endif



More information about the FFmpeg-soc mailing list