[FFmpeg-soc] [soc]: r1424 - in libavfilter: avfiltergraph.c diffs/03_ffplay_filters.diff

vitor subversion at mplayerhq.hu
Tue Oct 30 22:11:34 CET 2007


Author: vitor
Date: Tue Oct 30 22:11:34 2007
New Revision: 1424

Log:
Minor simplification

Modified:
   libavfilter/avfiltergraph.c
   libavfilter/diffs/03_ffplay_filters.diff

Modified: libavfilter/avfiltergraph.c
==============================================================================
--- libavfilter/avfiltergraph.c	(original)
+++ libavfilter/avfiltergraph.c	Tue Oct 30 22:11:34 2007
@@ -430,7 +430,6 @@ int avfilter_graph_config_links(AVFilter
 
 static AVFilterContext *create_filter_with_args(const char *filt, void *opaque)
 {
-    AVFilter *filterdef;
     AVFilterContext *ret;
     char *filter = av_strdup(filt); /* copy - don't mangle the input string */
     char *name, *args;
@@ -447,8 +446,7 @@ static AVFilterContext *create_filter_wi
     av_log(NULL, AV_LOG_INFO, "creating filter \"%s\" with args \"%s\"\n",
            name, args ? args : "(none)");
 
-    if((filterdef = avfilter_get_by_name(name)) &&
-       (ret = avfilter_open(filterdef, NULL))) {
+    if(ret = avfilter_open(avfilter_get_by_name(name), NULL)) {
         if(avfilter_init_filter(ret, args, opaque)) {
             av_log(NULL, AV_LOG_ERROR, "error initializing filter!\n");
             avfilter_destroy(ret);

Modified: libavfilter/diffs/03_ffplay_filters.diff
==============================================================================
--- libavfilter/diffs/03_ffplay_filters.diff	(original)
+++ libavfilter/diffs/03_ffplay_filters.diff	Tue Oct 30 22:11:34 2007
@@ -1,6 +1,6 @@
 --- ffplay.c.old2	2007-10-16 20:27:42.000000000 +0200
 +++ ffplay.c	2007-10-16 20:27:51.000000000 +0200
-@@ -25,6 +25,10 @@
+@@ -26,6 +26,10 @@
  #include "swscale.h"
  #include "avstring.h"
  
@@ -11,7 +11,7 @@
  #include "version.h"
  #include "cmdutils.h"
  
-@@ -84,6 +88,10 @@
+@@ -85,6 +89,10 @@
      int width, height; /* source height & width */
      enum PixelFormat pix_fmt;
      int allocated;
@@ -22,7 +22,7 @@
  } VideoPicture;
  
  typedef struct SubPicture {
-@@ -166,6 +174,10 @@
+@@ -167,6 +175,10 @@
      //    QETimer *video_timer;
      char filename[1024];
      int width, height, xleft, ytop;
@@ -33,7 +33,7 @@
  } VideoState;
  
  void show_help(void);
-@@ -205,6 +217,9 @@
+@@ -206,6 +218,9 @@
  static int error_resilience = FF_ER_CAREFUL;
  static int error_concealment = 3;
  static int decoder_reorder_pts= 0;
@@ -43,7 +43,7 @@
  
  /* current context */
  static int is_full_screen;
-@@ -651,14 +666,22 @@
+@@ -652,14 +667,22 @@
  
      vp = &is->pictq[is->pictq_rindex];
      if (vp->bmp) {
@@ -68,7 +68,7 @@
          /* if an active format is indicated, then it overrides the
             mpeg format */
  #if 0
-@@ -861,9 +884,15 @@
+@@ -862,9 +885,15 @@
      } else if(!is_full_screen && screen_width){
          w = screen_width;
          h = screen_height;
@@ -84,7 +84,7 @@
      } else {
          w = 640;
          h = 480;
-@@ -1169,9 +1198,19 @@
+@@ -1170,9 +1199,19 @@
      if (vp->bmp)
          SDL_FreeYUVOverlay(vp->bmp);
  
@@ -104,7 +104,7 @@
  
  #if 0
      /* XXX: use generic function */
-@@ -1208,7 +1247,7 @@
+@@ -1209,7 +1248,7 @@
  {
      VideoPicture *vp;
      int dst_pix_fmt;
@@ -113,7 +113,7 @@
      static struct SwsContext *img_convert_ctx;
  
      /* wait until we have space to put a new picture */
-@@ -1226,8 +1265,13 @@
+@@ -1227,8 +1266,13 @@
  
      /* alloc or resize hardware picture buffer */
      if (!vp->bmp ||
@@ -127,7 +127,7 @@
          SDL_Event event;
  
          vp->allocated = 0;
-@@ -1251,6 +1295,12 @@
+@@ -1252,6 +1296,12 @@
  
      /* if the frame is not skipped, then display it */
      if (vp->bmp) {
@@ -140,7 +140,7 @@
          /* get a pointer on the bitmap */
          SDL_LockYUVOverlay (vp->bmp);
  
-@@ -1262,6 +1312,19 @@
+@@ -1263,6 +1313,19 @@
          pict.linesize[0] = vp->bmp->pitches[0];
          pict.linesize[1] = vp->bmp->pitches[2];
          pict.linesize[2] = vp->bmp->pitches[1];
@@ -160,7 +160,7 @@
          img_convert_ctx = sws_getCachedContext(img_convert_ctx,
              vp->width, vp->height, vp->pix_fmt, vp->width, vp->height,
              dst_pix_fmt, sws_flags, NULL, NULL, NULL);
-@@ -1271,6 +1334,7 @@
+@@ -1272,6 +1335,7 @@
          }
          sws_scale(img_convert_ctx, src_frame->data, src_frame->linesize,
                    0, vp->height, pict.data, pict.linesize);
@@ -168,7 +168,7 @@
          /* update the bitmap content */
          SDL_UnlockYUVOverlay(vp->bmp);
  
-@@ -1378,6 +1442,134 @@
+@@ -1379,6 +1443,134 @@
      return 0;
  }
  
@@ -303,14 +303,13 @@
  static int video_thread(void *arg)
  {
      VideoState *is = arg;
-@@ -1386,10 +1578,47 @@
+@@ -1387,10 +1579,45 @@
      double pts;
      int ret;
  
 +
 +#if ENABLE_AVFILTER
 +    AVFilterContext *filt_src = NULL, *filt_out = NULL, *filt_graph = NULL;
-+    AVFilter *filterdef;
 +
 +    avfilter_init();
 +    //avfilter_register(&input_filter);
@@ -323,8 +322,7 @@
 +    if(avfilter_init_filter(filt_out, NULL, frame))          goto the_end;
 +
 +    if(vfilters) {
-+        if(!(filterdef = avfilter_get_by_name("graph")) ||
-+           !(filt_graph = avfilter_open(filterdef, NULL)))
++        if(!(filt_graph = avfilter_open(avfilter_get_by_name("graph"), NULL)))
 +            goto the_end;
 +        if(avfilter_init_filter(filt_graph, vfilters, NULL))
 +            goto the_end;
@@ -351,7 +349,7 @@
  
          if (ret < 0) goto the_end;
              pts  = pts_int;
-@@ -1402,6 +1631,10 @@
+@@ -1403,6 +1630,10 @@
                  stream_pause(cur_stream);
      }
   the_end:
@@ -362,7 +360,7 @@
      av_free(frame);
      return 0;
  }
-@@ -2131,6 +2364,12 @@
+@@ -2132,6 +2363,12 @@
      /* free all pictures */
      for(i=0;i<VIDEO_PICTURE_QUEUE_SIZE; i++) {
          vp = &is->pictq[i];
@@ -375,7 +373,7 @@
          if (vp->bmp) {
              SDL_FreeYUVOverlay(vp->bmp);
              vp->bmp = NULL;
-@@ -2487,6 +2726,9 @@
+@@ -2488,6 +2725,9 @@
  #endif
      { "sync", HAS_ARG | OPT_EXPERT, {(void*)opt_sync}, "set audio-video sync. type (type=audio/video/ext)", "type" },
      { "threads", HAS_ARG | OPT_EXPERT, {(void*)opt_thread_count}, "thread count", "count" },



More information about the FFmpeg-soc mailing list