mirror of https://git.ffmpeg.org/ffmpeg.git
Merge commit 'fe99c52fa99e44961a09cd1324aefd492b797fc8'
* commit 'fe99c52fa99e44961a09cd1324aefd492b797fc8': mp3: Properly use AVCodecContext API Conflicts: libavformat/mp3dec.c See:6ad42b3e15
See:b851bc20c6
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
2d37c57f3e
|
@ -32,6 +32,7 @@
|
||||||
#include "id3v1.h"
|
#include "id3v1.h"
|
||||||
#include "replaygain.h"
|
#include "replaygain.h"
|
||||||
|
|
||||||
|
#include "libavcodec/avcodec.h"
|
||||||
#include "libavcodec/mpegaudiodecheader.h"
|
#include "libavcodec/mpegaudiodecheader.h"
|
||||||
|
|
||||||
#define XING_FLAG_FRAMES 0x01
|
#define XING_FLAG_FRAMES 0x01
|
||||||
|
@ -64,7 +65,7 @@ static int mp3_read_probe(AVProbeData *p)
|
||||||
AVCodecContext *avctx = avcodec_alloc_context3(NULL);
|
AVCodecContext *avctx = avcodec_alloc_context3(NULL);
|
||||||
|
|
||||||
if (!avctx)
|
if (!avctx)
|
||||||
return 0;
|
return AVERROR(ENOMEM);
|
||||||
|
|
||||||
buf0 = p->buf;
|
buf0 = p->buf;
|
||||||
end = p->buf + p->buf_size - sizeof(uint32_t);
|
end = p->buf + p->buf_size - sizeof(uint32_t);
|
||||||
|
@ -82,7 +83,8 @@ static int mp3_read_probe(AVProbeData *p)
|
||||||
for(frames = 0; buf2 < end; frames++) {
|
for(frames = 0; buf2 < end; frames++) {
|
||||||
int dummy;
|
int dummy;
|
||||||
header = AV_RB32(buf2);
|
header = AV_RB32(buf2);
|
||||||
fsize = avpriv_mpa_decode_header(avctx, header, &dummy, &dummy, &dummy, &dummy);
|
fsize = avpriv_mpa_decode_header(avctx, header,
|
||||||
|
&dummy, &dummy, &dummy, &dummy);
|
||||||
if(fsize < 0)
|
if(fsize < 0)
|
||||||
break;
|
break;
|
||||||
buf2 += fsize;
|
buf2 += fsize;
|
||||||
|
|
Loading…
Reference in New Issue