]> granicus.if.org Git - handbrake/commitdiff
fix up usage of deprecated libav symbols and clean up patch fuzz
authorjstebbins <jstebbins.hb@gmail.com>
Tue, 7 Jun 2011 22:35:54 +0000 (22:35 +0000)
committerjstebbins <jstebbins.hb@gmail.com>
Tue, 7 Jun 2011 22:35:54 +0000 (22:35 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4030 b64f7644-9d1e-0410-96f1-a4d463321fa5

contrib/ffmpeg/A01-mpegleak.patch
contrib/ffmpeg/A02-audioconvert.patch
contrib/ffmpeg/A03-png-sequences.patch
contrib/ffmpeg/P01-solaris.patch
contrib/ffmpeg/P02-darwin-pic.patch
libhb/decavcodec.c
libhb/encavcodec.c
libhb/encavcodecaudio.c

index 44a99274eefd79671c1d9d97057bb859c6a62003..1ca462c6dc9d30e10c8b535c1caf2fce94f1b2fb 100644 (file)
@@ -1,8 +1,34 @@
-Index: libavcodec/mpegvideo.c
-===================================================================
---- ffmpeg.orig/libavcodec/mpegvideo.c (revision 22823)
-+++ ffmpeg/libavcodec/mpegvideo.c      (working copy)
-@@ -867,19 +867,18 @@
+diff --git a/libavcodec/h264.c b/libavcodec/h264.c
+index 0aa923f..15bf61d 100644
+--- a/libavcodec/h264.c
++++ b/libavcodec/h264.c
+@@ -3644,7 +3644,7 @@ static int decode_frame(AVCodecContext *avctx,
+     if(!(s->flags2 & CODEC_FLAG2_CHUNKS) && !s->current_picture_ptr){
+         if (avctx->skip_frame >= AVDISCARD_NONREF)
+             return 0;
+-        av_log(avctx, AV_LOG_ERROR, "no frame!\n");
++        av_log(avctx, AV_LOG_DEBUG, "no frame!\n");
+         return -1;
+     }
+diff --git a/libavcodec/h264_refs.c b/libavcodec/h264_refs.c
+index a025f7d..eda5e41 100644
+--- a/libavcodec/h264_refs.c
++++ b/libavcodec/h264_refs.c
+@@ -628,7 +628,7 @@ int ff_h264_execute_ref_pic_marking(H264Context *h, MMCO *mmco, int mmco_count){
+          * stream. Need to discard one frame. Prevents overrun of the
+          * short_ref and long_ref buffers.
+          */
+-        av_log(h->s.avctx, AV_LOG_ERROR,
++        av_log(h->s.avctx, AV_LOG_DEBUG,
+                "number of reference frames (%d+%d) exceeds max (%d; probably "
+                "corrupt input), discarding one\n",
+                h->long_ref_count, h->short_ref_count, h->sps.ref_frame_count);
+diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
+index 6a45da8..dc25c4d 100644
+--- a/libavcodec/mpegvideo.c
++++ b/libavcodec/mpegvideo.c
+@@ -986,19 +986,18 @@ int ff_find_unused_picture(MpegEncContext *s, int shared){
      }
  
      av_log(s->avctx, AV_LOG_FATAL, "Internal error, picture buffer overflow\n");
@@ -34,30 +60,3 @@ Index: libavcodec/mpegvideo.c
  }
  
  static void update_noise_reduction(MpegEncContext *s){
-Index: libavcodec/h264.c
-===================================================================
---- ffmpeg.orig/libavcodec/h264.c      (revision 22823)
-+++ ffmpeg/libavcodec/h264.c   (working copy)
-@@ -2772,8 +2772,8 @@
-     if(!(s->flags2 & CODEC_FLAG2_CHUNKS) && !s->current_picture_ptr){
-         if (avctx->skip_frame >= AVDISCARD_NONREF)
-             return 0;
--        av_log(avctx, AV_LOG_ERROR, "no frame!\n");
-+        av_log(avctx, AV_LOG_DEBUG, "no frame!\n");
-         return -1;
-     }
-Index: libavcodec/h264_refs.c
-===================================================================
---- ffmpeg.orig/libavcodec/h264_refs.c (revision 22823)
-+++ ffmpeg/libavcodec/h264_refs.c      (working copy)
-@@ -608,7 +608,7 @@
-          * stream. Need to discard one frame. Prevents overrun of the
-          * short_ref and long_ref buffers.
-          */
--        av_log(h->s.avctx, AV_LOG_ERROR,
-+        av_log(h->s.avctx, AV_LOG_DEBUG,
-                "number of reference frames (%d+%d) exceeds max (%d; probably "
-                "corrupt input), discarding one\n");
index 10e4cf1b548a1558f1ccbe8bad8bf3808de4d931..befe00fabce9eade0778e6112418eb0418f29ba2 100644 (file)
@@ -1,8 +1,8 @@
-Index: libavcodec/Makefile
-===================================================================
---- ffmpeg.orig/libavcodec/Makefile    (revision 22823)
-+++ ffmpeg/libavcodec/Makefile (working copy)
-@@ -3,7 +3,7 @@
+diff --git a/libavcodec/Makefile b/libavcodec/Makefile
+index b772bf1..17c4649 100644
+--- a/libavcodec/Makefile
++++ b/libavcodec/Makefile
+@@ -3,7 +3,7 @@ include $(SUBDIR)../config.mak
  NAME = avcodec
  FFLIBS = avutil
  
index 6f244170b3ece958a9e8f5f50ceef8b6920e553e..5be83fbb44fbaf332564de7d3020c608afa7cfb6 100644 (file)
@@ -1,8 +1,8 @@
-Index: libavcodec/pngdec.c
-===================================================================
---- ffmpeg.orig/libavcodec/pngdec.c    (revision 22823)
-+++ ffmpeg/libavcodec/pngdec.c (working copy)
-@@ -597,6 +597,18 @@
+diff --git a/libavcodec/pngdec.c b/libavcodec/pngdec.c
+index 7477f67..9e8e29b 100644
+--- a/libavcodec/pngdec.c
++++ b/libavcodec/pngdec.c
+@@ -599,6 +599,18 @@ static int decode_frame(AVCodecContext *avctx,
          }
      }
   exit_loop:
@@ -21,7 +21,7 @@ Index: libavcodec/pngdec.c
       /* handle p-frames only if a predecessor frame is available */
       if(s->last_picture->data[0] != NULL) {
           if(!(avpkt->flags & AV_PKT_FLAG_KEY)) {
-@@ -613,6 +625,7 @@
+@@ -615,6 +627,7 @@ static int decode_frame(AVCodecContext *avctx,
              }
          }
      }
index 4eadaa6c8bf2ad21d42e75ef2e34994d543c4a04..364e07adf837b8ec75a565aa9c5d2b0278187104 100644 (file)
@@ -1,8 +1,8 @@
-Index: configure
-===================================================================
---- ffmpeg.orig/configure      (revision 22823)
-+++ ffmpeg/configure   (working copy)
-@@ -54,6 +54,9 @@
+diff --git a/configure b/configure
+index 2a1883b..ab0c8b3 100755
+--- a/configure
++++ b/configure
+@@ -54,6 +54,9 @@ if test "$E1" != 0 || test "$E2" = 0; then
      exit 1
  fi
  
@@ -12,7 +12,7 @@ Index: configure
  show_help(){
  cat <<EOF
  Usage: configure [options]
-@@ -2387,7 +2390,7 @@
+@@ -2595,7 +2598,7 @@ EOF
  check_cc <<EOF || die "endian test failed"
  unsigned int endian = 'B' << 24 | 'I' << 16 | 'G' << 8 | 'E';
  EOF
index c151b2950e9cf2958b86fc49ac69dfa2d62e63c1..5df9815071c0359965bd2e37e8466cc4f0e719d1 100644 (file)
@@ -1,8 +1,8 @@
-Index: configure
-===================================================================
---- ffmpeg.orig/configure      (revision 22823)
-+++ ffmpeg/configure   (working copy)
-@@ -2191,6 +2191,7 @@
+diff --git a/configure b/configure
+index 2a1883b..4b4242a 100755
+--- a/configure
++++ b/configure
+@@ -2410,6 +2410,7 @@ case $target_os in
          FFSERVERLDFLAGS=-Wl,-bind_at_load
          objformat="macho"
          enabled x86_64 && objformat="macho64"
@@ -10,9 +10,9 @@ Index: configure
          enabled_any pic shared ||
              { check_cflags -mdynamic-no-pic && add_asflags -mdynamic-no-pic; }
          ;;
-@@ -2291,7 +2292,7 @@
-         ;;
- esac
+@@ -2521,7 +2522,7 @@ esac
+ echo "config:$arch:$subarch:$cpu:$target_os:$cc_ident:$LIBAV_CONFIGURATION" >config.fate
  
 -check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable pic
 +#check_cpp_condition stdlib.h "defined(__PIC__) || defined(__pic__) || defined(PIC)" && enable pic
index f41ad239db7e6aba285ad641613814901bc229cb..fd7d24f14bf63f78c2dccff569131a8e92987bfc 100644 (file)
@@ -1583,7 +1583,7 @@ static void decodeAudio( hb_audio_t * audio, hb_work_private_t *pv, uint8_t *dat
                 int isamp;
                 AVAudioConvert *ctx;
 
-                isamp = av_get_bits_per_sample_fmt( context->sample_fmt ) / 8;
+                isamp = av_get_bytes_per_sample( context->sample_fmt );
                 ctx = av_audio_convert_alloc( AV_SAMPLE_FMT_FLT, 1,
                                               context->sample_fmt, 1,
                                               NULL, 0 );
index 0a7d7f62b4384fc5a957db9531c8fd54c18b9bbf..da46db8c54d9720b5c91380c4d43379f378b117a 100644 (file)
@@ -489,29 +489,29 @@ int encavcodecWork( hb_work_object_t * w, hb_buffer_t ** buf_in,
             buf->flags &= ~HB_FRAME_REF;
             switch ( pv->context->coded_frame->pict_type )
             {
-                case FF_P_TYPE:
+                case AV_PICTURE_TYPE_P:
                 {
                     buf->frametype = HB_FRAME_P;
                 } break;
 
-                case FF_B_TYPE:
+                case AV_PICTURE_TYPE_B:
                 {
                     buf->frametype = HB_FRAME_B;
                 } break;
 
-                case FF_S_TYPE:
+                case AV_PICTURE_TYPE_S:
                 {
                     buf->frametype = HB_FRAME_P;
                 } break;
 
-                case FF_SP_TYPE:
+                case AV_PICTURE_TYPE_SP:
                 {
                     buf->frametype = HB_FRAME_P;
                 } break;
 
-                case FF_BI_TYPE:
-                case FF_SI_TYPE:
-                case FF_I_TYPE:
+                case AV_PICTURE_TYPE_BI:
+                case AV_PICTURE_TYPE_SI:
+                case AV_PICTURE_TYPE_I:
                 {
                     buf->flags |= HB_FRAME_REF;
                     if ( pv->context->coded_frame->key_frame )
index a295dc36816ec7709147032264686ab6e94596e8..3258ca042ee8ba0f7480e3c259c7048aa6d33596 100644 (file)
@@ -105,7 +105,7 @@ static int encavcodecaInit( hb_work_object_t * w, hb_job_t * job )
 
     // Set a reasonable maximum output size
     pv->output_bytes = context->frame_size * 
-        (av_get_bits_per_sample_fmt(context->sample_fmt) / 8) * 
+        av_get_bytes_per_sample(context->sample_fmt) * 
         context->channels;
 
     pv->buf = malloc( pv->input_samples * sizeof( float ) );
@@ -206,8 +206,8 @@ static hb_buffer_t * Encode( hb_work_object_t * w )
         int isamp, osamp;
         AVAudioConvert *ctx;
 
-        isamp = av_get_bits_per_sample_fmt( AV_SAMPLE_FMT_FLT ) / 8;
-        osamp = av_get_bits_per_sample_fmt( pv->context->sample_fmt ) / 8;
+        isamp = av_get_bytes_per_sample( AV_SAMPLE_FMT_FLT );
+        osamp = av_get_bytes_per_sample( pv->context->sample_fmt );
         ctx = av_audio_convert_alloc( pv->context->sample_fmt, 1,
                                       AV_SAMPLE_FMT_FLT, 1,
                                       NULL, 0 );