Contents of /trunk/gpac/patches/gpac-0.4.5-ffmpeg-snapshots-compat.patch
Parent Directory | Revision Log
Revision 925 -
(show annotations)
(download)
Wed Nov 4 15:18:09 2009 UTC (14 years, 10 months ago) by niro
File size: 1215 byte(s)
Wed Nov 4 15:18:09 2009 UTC (14 years, 10 months ago) by niro
File size: 1215 byte(s)
-fixes for 0.4.5-r1
1 | Index: gpac/modules/ffmpeg_in/ffmpeg_decode.c |
2 | =================================================================== |
3 | --- gpac.orig/modules/ffmpeg_in/ffmpeg_decode.c |
4 | +++ gpac/modules/ffmpeg_in/ffmpeg_decode.c |
5 | @@ -241,7 +241,7 @@ static GF_Err FFDEC_AttachStream(GF_Base |
6 | |
7 | /*setup audio streams*/ |
8 | if (ffd->st==GF_STREAM_AUDIO) { |
9 | - if ((ffd->codec->type == CODEC_ID_MP3LAME) || (ffd->codec->type == CODEC_ID_MP2)) { |
10 | + if ((ffd->codec->type == CODEC_ID_MP3) || (ffd->codec->type == CODEC_ID_MP2)) { |
11 | ffd->ctx->frame_size = (ffd->ctx->sample_rate > 24000) ? 1152 : 576; |
12 | } |
13 | /*may be 0 (cfg not known yet)*/ |
14 | @@ -446,7 +446,8 @@ static GF_Err FFDEC_ProcessData(GF_Media |
15 | if (ffd->frame_start>inBufferLength) ffd->frame_start = 0; |
16 | |
17 | redecode: |
18 | - len = avcodec_decode_audio(ffd->ctx, (short *)ffd->audio_buf, &gotpic, inBuffer + ffd->frame_start, inBufferLength - ffd->frame_start); |
19 | + gotpic=AVCODEC_MAX_AUDIO_FRAME_SIZE; |
20 | + len = avcodec_decode_audio2(ffd->ctx, (short *)ffd->audio_buf, &gotpic, inBuffer + ffd->frame_start, inBufferLength - ffd->frame_start); |
21 | |
22 | if (len<0) { ffd->frame_start = 0; return GF_NON_COMPLIANT_BITSTREAM; } |
23 | if (gotpic<0) { ffd->frame_start = 0; return GF_OK; } |