]> git.pld-linux.org Git - packages/transcode.git/blob - transcode-ffmpeg.patch
- fix build with new ffmpeg
[packages/transcode.git] / transcode-ffmpeg.patch
1 Index: transcode-1.1.5/encode/encode_lavc.c
2 ===================================================================
3 --- transcode-1.1.5.orig/encode/encode_lavc.c
4 +++ transcode-1.1.5/encode/encode_lavc.c
5 @@ -955,8 +955,6 @@ static void tc_lavc_config_defaults(TCLa
6      /* 
7       * context *transcode* (not libavcodec) defaults
8       */
9 -    pd->ff_vcontext.mb_qmin                 = 2;
10 -    pd->ff_vcontext.mb_qmax                 = 31;
11      pd->ff_vcontext.max_qdiff               = 3;
12      pd->ff_vcontext.max_b_frames            = 0;
13      pd->ff_vcontext.me_range                = 0;
14 @@ -1116,8 +1114,6 @@ static int tc_lavc_read_config(TCLavcPri
15          //  handled by transcode core
16          //  { "vqmax", PCTX(qmax), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 60 },
17          //  handled by transcode core
18 -        { "mbqmin", PCTX(mb_qmin), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 60 },
19 -        { "mbqmax", PCTX(mb_qmax), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 60 },
20          { "lmin", PAUX(lmin), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.01, 255.0 },
21          { "lmax", PAUX(lmax), TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.01, 255.0 },
22          { "vqdiff", PCTX(max_qdiff), TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31 },
23 Index: transcode-1.1.5/export/aud_aux.c
24 ===================================================================
25 --- transcode-1.1.5.orig/export/aud_aux.c
26 +++ transcode-1.1.5/export/aud_aux.c
27 @@ -347,7 +347,7 @@ static int tc_audio_init_ffmpeg(vob_t *v
28      //-- set parameters (bitrate, channels and sample-rate) --
29      //--------------------------------------------------------
30      memset(&mpa_ctx, 0, sizeof(mpa_ctx));          // default all
31 -    mpa_ctx.codec_type  = CODEC_TYPE_AUDIO;
32 +    mpa_ctx.codec_type  = AVMEDIA_TYPE_AUDIO;
33      mpa_ctx.bit_rate    = vob->mp3bitrate * 1000;  // bitrate dest.
34      mpa_ctx.channels    = vob->dm_chan;            // channels
35      mpa_ctx.sample_rate = vob->a_rate;
36 Index: transcode-1.1.5/export/export_ffmpeg.c
37 ===================================================================
38 --- transcode-1.1.5.orig/export/export_ffmpeg.c
39 +++ transcode-1.1.5/export/export_ffmpeg.c
40 @@ -643,8 +643,6 @@ MOD_init
41  
42      lavc_venc_context->bit_rate           = vob->divxbitrate * 1000;
43      lavc_venc_context->bit_rate_tolerance = lavc_param_vrate_tolerance * 1000;
44 -    lavc_venc_context->mb_qmin            = lavc_param_mb_qmin;
45 -    lavc_venc_context->mb_qmax            = lavc_param_mb_qmax;
46      lavc_venc_context->lmin= (int)(FF_QP2LAMBDA * lavc_param_lmin + 0.5);
47      lavc_venc_context->lmax= (int)(FF_QP2LAMBDA * lavc_param_lmax + 0.5);
48      lavc_venc_context->max_qdiff          = lavc_param_vqdiff;
49 Index: transcode-1.1.5/import/decode_lavc.c
50 ===================================================================
51 --- transcode-1.1.5.orig/import/decode_lavc.c
52 +++ transcode-1.1.5/import/decode_lavc.c
53 @@ -261,8 +261,12 @@ void decode_lavc(decode_t *decode)
54  
55        //tc_log_msg(__FILE__, "SIZE: (%d) MP4(%d) blen(%d) BUF(%d) read(%ld)", len, mp4_size, buf_len, READ_BUFFER_SIZE, bytes_read);
56        do {
57 -         len = avcodec_decode_video(lavc_dec_context, &picture,
58 -                 &got_picture, buffer+buf_len, mp4_size-buf_len);
59 +          AVPacket pkt;
60 +         av_init_packet( &pkt );
61 +         pkt.data = buffer+buf_len;
62 +         pkt.size = mp4_size-buf_len;
63 +         len = avcodec_decode_video2(lavc_dec_context, &picture,
64 +                 &got_picture, &pkt);
65  
66           if (len < 0) {
67               tc_log_error(__FILE__, "frame decoding failed");
68 Index: transcode-1.1.5/import/probe_ffmpeg.c
69 ===================================================================
70 --- transcode-1.1.5.orig/import/probe_ffmpeg.c
71 +++ transcode-1.1.5/import/probe_ffmpeg.c
72 @@ -47,7 +47,7 @@ static void translate_info(const AVForma
73      for (i = 0; i < ctx->nb_streams; i++) {
74          st = ctx->streams[i];
75  
76 -        if (st->codec->codec_type == CODEC_TYPE_VIDEO) {
77 +        if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
78              info->bitrate = st->codec->bit_rate / 1000;
79              info->width = st->codec->width;
80              info->height = st->codec->height;
81 @@ -65,7 +65,7 @@ static void translate_info(const AVForma
82      for (i = 0; i < ctx->nb_streams; i++) {
83          st = ctx->streams[i];
84  
85 -        if (st->codec->codec_type == CODEC_TYPE_AUDIO
86 +        if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO
87           && j < TC_MAX_AUD_TRACKS) {
88              info->track[j].format = 0x1; /* known wrong */
89              info->track[j].chan = st->codec->channels;
90 Index: transcode-1.1.5/export/ffmpeg_cfg.c
91 ===================================================================
92 --- transcode-1.1.5.orig/export/ffmpeg_cfg.c
93 +++ transcode-1.1.5/export/ffmpeg_cfg.c
94 @@ -34,8 +34,6 @@ int lavc_param_vme = 4;
95  //int lavc_param_vqscale = 0;
96  //int lavc_param_vqmin = 2;
97  //int lavc_param_vqmax = 31;
98 -int lavc_param_mb_qmin = 2;
99 -int lavc_param_mb_qmax = 31;
100  int lavc_param_lmin = 2;
101  int lavc_param_lmax = 31;
102  int lavc_param_vqdiff = 3;
103 @@ -140,8 +138,6 @@ TCConfigEntry lavcopts_conf[]={
104  //    {"vqscale", &lavc_param_vqscale, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
105  //    {"vqmin", &lavc_param_vqmin, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
106  //    {"vqmax", &lavc_param_vqmax, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
107 -    {"mbqmin", &lavc_param_mb_qmin, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
108 -    {"mbqmax", &lavc_param_mb_qmax, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
109      {"lmin", &lavc_param_lmin, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.01, 255.0},
110      {"lmax", &lavc_param_lmax, TCCONF_TYPE_FLOAT, TCCONF_FLAG_RANGE, 0.01, 255.0},
111      {"vqdiff", &lavc_param_vqdiff, TCCONF_TYPE_INT, TCCONF_FLAG_RANGE, 1, 31},
112 Index: transcode-1.1.5/export/ffmpeg_cfg.h
113 ===================================================================
114 --- transcode-1.1.5.orig/export/ffmpeg_cfg.h
115 +++ transcode-1.1.5/export/ffmpeg_cfg.h
116 @@ -13,8 +13,6 @@ extern int lavc_param_vme;
117  //extern int lavc_param_vqscale;
118  //extern int lavc_param_vqmin;
119  //extern int lavc_param_vqmax;
120 -extern int lavc_param_mb_qmin;
121 -extern int lavc_param_mb_qmax;
122  extern int lavc_param_lmin;
123  extern int lavc_param_lmax;
124  extern int lavc_param_vqdiff;
This page took 0.064914 seconds and 3 git commands to generate.