]> git.pld-linux.org Git - packages/xine-lib.git/blob - xine-lib-ffmpeg-0.8.patch
- added ffmpeg-0.8 patch
[packages/xine-lib.git] / xine-lib-ffmpeg-0.8.patch
1 --- xine-lib-1.1.19/src/combined/ffmpeg/ff_video_decoder.c.orig 2010-03-10 20:07:15.000000000 +0100
2 +++ xine-lib-1.1.19/src/combined/ffmpeg/ff_video_decoder.c      2011-06-27 21:46:28.835606968 +0200
3 @@ -1055,12 +1055,16 @@ static void ff_handle_mpeg12_buffer (ff_
4      }
5  
6      /* skip decoding b frames if too late */
7 -    this->context->hurry_up = (this->skipframes > 0);
8 +    this->context->skip_frame = (this->skipframes > 0) ? AVDISCARD_NONREF : AVDISCARD_DEFAULT;
9  
10      lprintf("avcodec_decode_video: size=%d\n", this->mpeg_parser->buffer_size);
11 -    len = avcodec_decode_video (this->context, this->av_frame,
12 -                                &got_picture, this->mpeg_parser->chunk_buffer,
13 -                                this->mpeg_parser->buffer_size);
14 +    AVPacket avpkt;
15 +    av_init_packet(&avpkt);
16 +    avpkt.data = (uint8_t *)this->mpeg_parser->chunk_buffer;
17 +    avpkt.size = this->mpeg_parser->buffer_size;
18 +    avpkt.flags = AV_PKT_FLAG_KEY;
19 +    len = avcodec_decode_video2 (this->context, this->av_frame,
20 +                                &got_picture, &avpkt);
21      lprintf("avcodec_decode_video: decoded_size=%d, got_picture=%d\n",
22              len, got_picture);
23      len = current - buf->content - offset;
24 @@ -1112,7 +1116,7 @@ static void ff_handle_mpeg12_buffer (ff_
25  
26      } else {
27  
28 -      if (this->context->hurry_up) {
29 +      if (this->context->skip_frame != AVDISCARD_DEFAULT) {
30          /* skipped frame, output a bad frame */
31          img = this->stream->video_out->get_frame (this->stream->video_out,
32                                                    this->bih.biWidth,
33 @@ -1304,12 +1308,16 @@ static void ff_handle_buffer (ff_video_d
34          got_picture = 0;
35        } else {
36          /* skip decoding b frames if too late */
37 -        this->context->hurry_up = (this->skipframes > 0);
38 +        this->context->skip_frame = (this->skipframes > 0) ? AVDISCARD_NONREF : AVDISCARD_DEFAULT;
39  
40          lprintf("buffer size: %d\n", this->size);
41 -        len = avcodec_decode_video (this->context, this->av_frame,
42 -                                    &got_picture, &chunk_buf[offset],
43 -                                    this->size);
44 +       AVPacket avpkt;
45 +       av_init_packet(&avpkt);
46 +       avpkt.data = (uint8_t *)&chunk_buf[offset];
47 +       avpkt.size = this->size;
48 +       avpkt.flags = AV_PKT_FLAG_KEY;
49 +       len = avcodec_decode_video2 (this->context, this->av_frame,
50 +                                    &got_picture, &avpkt);
51  
52  #ifdef AVCODEC_HAS_REORDERED_OPAQUE
53          /* reset consumed pts value */
54 --- xine-lib-1.1.19/src/combined/ffmpeg/ff_audio_decoder.c.orig 2010-03-23 16:41:49.000000000 +0100
55 +++ xine-lib-1.1.19/src/combined/ffmpeg/ff_audio_decoder.c      2011-06-27 21:29:30.168906191 +0200
56 @@ -255,6 +255,7 @@ static void ff_audio_decode_data (audio_
57        buf->decoder_info[2]);
58  
59    } else if (!(buf->decoder_flags & BUF_FLAG_SPECIAL)) {
60 +    AVPacket avpkt;
61  
62      if( !this->decoder_ok ) {
63        if ( ! this->context || ! this->codec ) {
64 @@ -286,11 +287,13 @@ static void ff_audio_decode_data (audio_
65      if (!this->output_open) {
66        if (!this->audio_bits || !this->audio_sample_rate || !this->audio_channels) {
67          decode_buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
68 -        avcodec_decode_audio2 (this->context,
69 -                              (int16_t *)this->decode_buffer,
70 -                              &decode_buffer_size,
71 -                              &this->buf[0],
72 -                              this->size);
73 +       av_init_packet(&avpkt);
74 +       avpkt.data = (uint8_t *)&this->buf[0];
75 +       avpkt.size = this->size;
76 +       avpkt.flags = AV_PKT_FLAG_KEY;
77 +       avcodec_decode_audio3 (this->context,
78 +                             (int16_t *)this->decode_buffer,
79 +                             &decode_buffer_size, &avpkt);
80         this->audio_bits = this->context->bits_per_sample;
81         this->audio_sample_rate = this->context->sample_rate;
82         this->audio_channels = this->context->channels;
83 @@ -311,11 +314,13 @@ static void ff_audio_decode_data (audio_
84        offset = 0;
85        while (this->size>0) {
86          decode_buffer_size = AVCODEC_MAX_AUDIO_FRAME_SIZE;
87 -        bytes_consumed = avcodec_decode_audio2 (this->context,
88 -                                               (int16_t *)this->decode_buffer,
89 -                                               &decode_buffer_size,
90 -                                               &this->buf[offset],
91 -                                               this->size);
92 +       av_init_packet(&avpkt);
93 +       avpkt.data = (uint8_t *)&this->buf[offset];
94 +       avpkt.size = this->size;
95 +       avpkt.flags = AV_PKT_FLAG_KEY;
96 +       bytes_consumed = avcodec_decode_audio3 (this->context,
97 +                                              (int16_t *)this->decode_buffer,
98 +                                              &decode_buffer_size, &avpkt);
99  
100          if (bytes_consumed<0) {
101            xprintf (this->stream->xine, XINE_VERBOSITY_DEBUG,
This page took 0.028646 seconds and 3 git commands to generate.