OSDN Git Service

bump ffmpeg from 25082 to 25374
authorjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Tue, 12 Oct 2010 17:16:19 +0000 (17:16 +0000)
committerjstebbins <jstebbins@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Tue, 12 Oct 2010 17:16:19 +0000 (17:16 +0000)
fixes h264 decoding issue

git-svn-id: svn://localhost/HandBrake/trunk@3599 b64f7644-9d1e-0410-96f1-a4d463321fa5

contrib/ffmpeg/module.defs
libhb/decavcodec.c
libhb/decmpeg2.c
libhb/hb.c
libhb/hbffmpeg.h
libhb/render.c

index bca9057..9222b8c 100644 (file)
@@ -1,7 +1,7 @@
 $(eval $(call import.MODULE.defs,FFMPEG,ffmpeg,BZIP2 FAAD2 ZLIB))
 $(eval $(call import.CONTRIB.defs,FFMPEG))
 
-FFMPEG.FETCH.url = http://download.m0k.org/handbrake/contrib/ffmpeg-r25082.tar.bz2
+FFMPEG.FETCH.url = http://download.m0k.org/handbrake/contrib/ffmpeg-r25374.tar.bz2
 
 FFMPEG.CONFIGURE.deps =
 FFMPEG.CONFIGURE.env  =
index bbdd4d6..019f595 100644 (file)
@@ -510,10 +510,9 @@ static hb_buffer_t *copy_frame( hb_work_private_t *pv, AVFrame *frame )
 
         if ( ! pv->sws_context )
         {
-            pv->sws_context = sws_getContext( context->width, context->height, context->pix_fmt,
+            pv->sws_context = hb_sws_get_context( context->width, context->height, context->pix_fmt,
                                               w, h, PIX_FMT_YUV420P,
-                                              SWS_LANCZOS|SWS_ACCURATE_RND,
-                                              NULL, NULL, NULL );
+                                              SWS_LANCZOS|SWS_ACCURATE_RND);
         }
         sws_scale( pv->sws_context, frame->data, frame->linesize, 0, h,
                    dstpic.data, dstpic.linesize );
index 63f2ebb..3beef06 100644 (file)
@@ -291,10 +291,9 @@ static hb_buffer_t *hb_copy_frame( hb_job_t *job, int width, int height,
             memcpy( in.data[1], u, src_wh >> 2 );
             memcpy( in.data[2], v, src_wh >> 2 );
         }
-        struct SwsContext *context = sws_getContext( width, height, pixfmt,
+        struct SwsContext *context = hb_sws_get_context( width, height, pixfmt,
                                                      dst_w, dst_h, PIX_FMT_YUV420P,
-                                                     SWS_LANCZOS|SWS_ACCURATE_RND,
-                                                     NULL, NULL, NULL );
+                                                     SWS_LANCZOS|SWS_ACCURATE_RND);
         sws_scale( context, in.data, in.linesize, 0, height, out.data, out.linesize );
         sws_freeContext( context );
 
index e26c8e6..49f1cb9 100644 (file)
@@ -91,6 +91,41 @@ int hb_av_find_stream_info(AVFormatContext *ic)
     return ret;
 }
 
+struct SwsContext*
+hb_sws_get_context(int srcW, int srcH, enum PixelFormat srcFormat,
+                   int dstW, int dstH, enum PixelFormat dstFormat,
+                   int flags)
+{
+    struct SwsContext * ctx;
+
+#if 0
+    // sws_getContext is being depricated.  But it appears that
+    // the new method isn't quite wrung out yet.  So when it is
+    // this code should be fixed up and enabled.
+    ctx = sws_alloc_context();
+    if ( ctx )
+    {
+        av_set_int(ctx, "srcw", srcW);
+        av_set_int(ctx, "srch", srcH);
+        av_set_int(ctx, "src_format", srcFormat);
+        av_set_int(ctx, "dstw", dstW);
+        av_set_int(ctx, "dsth", dstH);
+        av_set_int(ctx, "dst_format", dstFormat);
+        av_set_int(ctx, "sws_flags", flags);
+
+        if (sws_init_context(ctx, NULL, NULL) < 0) {
+            fprintf(stderr, "Cannot initialize resampling context\n");
+            sws_freeContext(ctx);
+            ctx = NULL;
+        } 
+    }
+#else
+    ctx = sws_getContext(srcW, srcH, srcFormat, dstW, dstH, dstFormat, 
+                         flags, NULL, NULL, NULL);
+#endif
+    return ctx;
+}
+
 int hb_avcodec_close(AVCodecContext *avctx)
 {
     int ret;
@@ -665,11 +700,11 @@ void hb_get_preview( hb_handle_t * h, hb_title_t * title, int picture,
     }
 
     // Get scaling context
-    context = sws_getContext(title->width  - (job->crop[2] + job->crop[3]),
+    context = hb_sws_get_context(title->width  - (job->crop[2] + job->crop[3]),
                              title->height - (job->crop[0] + job->crop[1]),
                              PIX_FMT_YUV420P,
                              job->width, job->height, PIX_FMT_YUV420P,
-                             swsflags, NULL, NULL, NULL);
+                             swsflags);
 
     // Scale
     sws_scale(context,
@@ -681,9 +716,9 @@ void hb_get_preview( hb_handle_t * h, hb_title_t * title, int picture,
     sws_freeContext( context );
 
     // Get preview context
-    context = sws_getContext(rgb_width, job->height, PIX_FMT_YUV420P,
+    context = hb_sws_get_context(rgb_width, job->height, PIX_FMT_YUV420P,
                               rgb_width, job->height, PIX_FMT_RGB32,
-                              swsflags, NULL, NULL, NULL);
+                              swsflags);
 
     // Create preview
     sws_scale(context,
index 8a7dc90..9953aa7 100644 (file)
@@ -11,3 +11,7 @@ int hb_avcodec_open( AVCodecContext *, struct AVCodec * );
 int hb_avcodec_close( AVCodecContext * );
 int hb_av_find_stream_info(AVFormatContext *ic);
 int hb_ff_layout_xlat(int64_t ff_layout, int channels);
+struct SwsContext*
+hb_sws_get_context(int srcW, int srcH, enum PixelFormat srcFormat,
+                   int dstW, int dstH, enum PixelFormat dstFormat,
+                   int flags);
index 98bc7fe..8c7e9a2 100644 (file)
@@ -721,11 +721,11 @@ int renderInit( hb_work_object_t * w, hb_job_t * job )
     if( job->crop[0] || job->crop[1] || job->crop[2] || job->crop[3] ||
         job->width != title->width || job->height != title->height )
     {
-        pv->context = sws_getContext(title->width  - (job->crop[2] + job->crop[3]),
+        pv->context = hb_sws_get_context(title->width  - (job->crop[2] + job->crop[3]),
                                      title->height - (job->crop[0] + job->crop[1]),
                                      PIX_FMT_YUV420P,
                                      job->width, job->height, PIX_FMT_YUV420P,
-                                     swsflags, NULL, NULL, NULL);
+                                     swsflags);
     }
 
     /* Setup FIFO queue for subtitle cache */