]> git.pld-linux.org Git - packages/cinelerra-cv.git/blob - cinelerra-cv-ffmpeg.patch
6f7962fb1a54e8c322c04a2b33e9bb0c17babe51
[packages/cinelerra-cv.git] / cinelerra-cv-ffmpeg.patch
1 Fix build with ffmpeg/libav trunk / 0.7
2
3 Index: cinelerra-20101104/cinelerra/ffmpeg.C
4 ===================================================================
5 --- cinelerra-20101104.orig/cinelerra/ffmpeg.C
6 +++ cinelerra-20101104/cinelerra/ffmpeg.C
7 @@ -364,12 +364,15 @@ int FFMPEG::decode(uint8_t *data, long d
8  
9         // NOTE: frame must already have data space allocated
10         
11 +       AVPacket pkt;
12         got_picture = 0;
13 -       int length = avcodec_decode_video(context,
14 +       av_init_packet( &pkt );
15 +       pkt.data = data;
16 +       pkt.size = data_size;
17 +       int length = avcodec_decode_video2(context,
18                                           picture,
19                                           &got_picture,
20 -                                         data,
21 -                                         data_size);
22 +                                         &pkt);
23         
24         if (length < 0) {
25                 printf("FFMPEG::decode error decoding frame\n");
26 Index: cinelerra-20101104/quicktime/qtffmpeg.c
27 ===================================================================
28 --- cinelerra-20101104.orig/quicktime/qtffmpeg.c
29 +++ cinelerra-20101104/quicktime/qtffmpeg.c
30 @@ -181,6 +181,7 @@ static int decode_wrapper(quicktime_t *f
31   
32         if(!result) 
33         { 
34 +               AVPacket pkt;
35  
36  
37  // No way to determine if there was an error based on nonzero status.
38 @@ -189,11 +190,13 @@ static int decode_wrapper(quicktime_t *f
39                         ffmpeg->decoder_context[current_field]->skip_frame = AVDISCARD_NONREF /* AVDISCARD_BIDIR */;
40                 else
41                         ffmpeg->decoder_context[current_field]->skip_frame = AVDISCARD_DEFAULT;
42 -               result = avcodec_decode_video(ffmpeg->decoder_context[current_field], 
43 +               av_init_packet( &pkt );
44 +               pkt.data = ffmpeg->work_buffer;
45 +               pkt.size = bytes + header_bytes;
46 +               result = avcodec_decode_video2(ffmpeg->decoder_context[current_field], 
47                         &ffmpeg->picture[current_field], 
48                         &got_picture, 
49 -                       ffmpeg->work_buffer, 
50 -                       bytes + header_bytes);
51 +                       &pkt);
52  
53  
54  
55 Index: cinelerra-20101104/quicktime/wma.c
56 ===================================================================
57 --- cinelerra-20101104.orig/quicktime/wma.c
58 +++ cinelerra-20101104/quicktime/wma.c
59 @@ -195,11 +195,14 @@ printf("decode 2 %x %llx %llx\n", chunk_
60                         chunk_size);
61  #else
62                 bytes_decoded = AVCODEC_MAX_AUDIO_FRAME_SIZE;
63 -               result = avcodec_decode_audio2(codec->decoder_context,
64 +               AVPacket pkt;
65 +               av_init_packet( &pkt );
66 +               pkt.data = codec->packet_buffer;
67 +               pkt.size = chunk_size;
68 +               result = avcodec_decode_audio3(codec->decoder_context,
69                         (int16_t*)(codec->work_buffer + codec->output_size * sample_size),
70                         &bytes_decoded,
71 -                       codec->packet_buffer,
72 -                       chunk_size);
73 +                       &pkt);
74  #endif
75  
76                 pthread_mutex_unlock(&ffmpeg_lock);
This page took 0.032132 seconds and 2 git commands to generate.