Commits

Francesco Romani committed bb346f5

[misc][patch][debian][ffmmpeg] ffmpeg 0.8 compatibility: partly apply patchset from debian package.

applied:
02_toolame.diff
06-ffmpeg-0.8.diff

Comments (0)

Files changed (6)

export/export_ffmpeg.c

 
     lavc_venc_context->bit_rate           = vob->divxbitrate * 1000;
     lavc_venc_context->bit_rate_tolerance = lavc_param_vrate_tolerance * 1000;
-    lavc_venc_context->mb_qmin            = lavc_param_mb_qmin;
-    lavc_venc_context->mb_qmax            = lavc_param_mb_qmax;
     lavc_venc_context->lmin= (int)(FF_QP2LAMBDA * lavc_param_lmin + 0.5);
     lavc_venc_context->lmax= (int)(FF_QP2LAMBDA * lavc_param_lmax + 0.5);
     lavc_venc_context->max_qdiff          = lavc_param_vqdiff;

export/export_toolame.c

  *
  */
 
-#define MOD_NAME    "export_toolame.so"
+#define MOD_NAME    "export_twolame.so"
 #define MOD_VERSION "v1.0.6 (2004-01-26)"
 #define MOD_CODEC   "(audio) MPEG 1/2"
 
 static int 			verbose_flag	= TC_QUIET;
 static int 			capability_flag	= TC_CAP_PCM;
 
-#define MOD_PRE toolame
+#define MOD_PRE twolame
 #include "export_def.h"
 
 static FILE* 			pFile 		= NULL;
     char chan;
     char *ptr;
 
-    /* check for toolame */
-    if (tc_test_program("toolame") != 0) return (TC_EXPORT_ERROR);
+    /* check for twolame */
+    if (tc_test_program("twolame") != 0) return (TC_EXPORT_ERROR);
 
     /* verbose? */
     verb = (verbose & TC_DEBUG) ? 2:0;
     ofreq_dec = ofreq-ofreq_int*1000;
     */
 
-    /* toolame command line */
+    /* twolame command line */
     /* ptr is a pointer into buf */
     tc_snprintf(ptr, sizeof(buf) - (ptr-buf),
-		"toolame -s %0.3f -b %d -m %c - \"%s\" 2>/dev/null %s",
+		"twolame -s %0.3f -b %d -m %c - \"%s\" 2>/dev/null %s",
 		(double)ofreq/1000.0, orate, chan, vob->audio_out_file,
 		(vob->ex_a_string?vob->ex_a_string:""));
 

filter/filter_resample.c

         goto abort;
     }
 
-    pd->resample_ctx = audio_resample_init(vob->a_chan, vob->a_chan,
-                                           vob->mp3frequency, vob->a_rate);
+    pd->resample_ctx = av_audio_resample_init(vob->a_chan, vob->a_chan,
+                                           vob->mp3frequency, vob->a_rate,
+                                           AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16,
+                                           16, 10, 0, 0.8);
     if (pd->resample_ctx == NULL) {
         tc_log_error(MOD_NAME, "can't get a resample context");
         goto abort;

import/decode_lavc.c

 
       //tc_log_msg(__FILE__, "SIZE: (%d) MP4(%d) blen(%d) BUF(%d) read(%ld)", len, mp4_size, buf_len, READ_BUFFER_SIZE, bytes_read);
       do {
-	  len = avcodec_decode_video(lavc_dec_context, &picture,
-		  &got_picture, buffer+buf_len, mp4_size-buf_len);
+          AVPacket avpkt;
+          av_init_packet(&avpkt);
+          avpkt.data = NULL;
+          avpkt.size = 0;
+	  len = avcodec_decode_video2(lavc_dec_context, &picture,
+		  &got_picture, &avpkt);
 
 	  if (len < 0) {
 	      tc_log_error(__FILE__, "frame decoding failed");

import/import_ffmpeg.c

 retry:
     do {
       TC_LOCK_LIBAVCODEC;
-      len = avcodec_decode_video(lavc_dec_context, &picture,
-			         &got_picture, buffer, bytes_read);
+      AVPacket avpkt;
+      av_init_packet(&avpkt);
+      avpkt.data = NULL;
+      avpkt.size = 0;
+      len = avcodec_decode_video2(lavc_dec_context, &picture,
+			         &got_picture, &avpkt);
       TC_UNLOCK_LIBAVCODEC;
 
       if (len < 0) {

import/probe_ffmpeg.c

     for (i = 0; i < ctx->nb_streams; i++) {
         st = ctx->streams[i];
 
-        if (st->codec->codec_type == CODEC_TYPE_VIDEO) {
+        if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
             info->bitrate = st->codec->bit_rate / 1000;
             info->width = st->codec->width;
             info->height = st->codec->height;
     for (i = 0; i < ctx->nb_streams; i++) {
         st = ctx->streams[i];
 
-        if (st->codec->codec_type == CODEC_TYPE_AUDIO
+        if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO
          && j < TC_MAX_AUD_TRACKS) {
             info->track[j].format = 0x1; /* known wrong */
             info->track[j].chan = st->codec->channels;