|
@ -20,7 +20,25 @@ |
|
|
return -1; |
|
|
return -1; |
|
|
if (enc->codec_type != AVMEDIA_TYPE_AUDIO) { |
|
|
if (enc->codec_type != AVMEDIA_TYPE_AUDIO) { |
|
|
lsx_fail("ffmpeg CODEC %x is not an audio CODEC", enc->codec_type); |
|
|
lsx_fail("ffmpeg CODEC %x is not an audio CODEC", enc->codec_type); |
|
|
@@ -267,7 +271,11 @@ static int stopread(sox_format_t * ft)
|
|
|
|
|
|
|
|
|
@@ -178,7 +182,7 @@ static int startread(sox_format_t * ft)
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* Get CODEC parameters */ |
|
|
|
|
|
- if ((ret = av_find_stream_info(ffmpeg->ctxt)) < 0) {
|
|
|
|
|
|
+ if ((ret = avformat_find_stream_info(ffmpeg->ctxt, NULL)) < 0) {
|
|
|
|
|
|
lsx_fail("ffmpeg could not find CODEC parameters for %s", ft->filename); |
|
|
|
|
|
return SOX_EOF; |
|
|
|
|
|
} |
|
|
|
|
|
@@ -256,7 +260,7 @@ static int stopread(sox_format_t * ft)
|
|
|
|
|
|
if (ffmpeg->audio_stream >= 0) |
|
|
|
|
|
stream_component_close(ffmpeg, ffmpeg->audio_stream); |
|
|
|
|
|
if (ffmpeg->ctxt) { |
|
|
|
|
|
- av_close_input_file(ffmpeg->ctxt);
|
|
|
|
|
|
+ avformat_close_input(&ffmpeg->ctxt);
|
|
|
|
|
|
ffmpeg->ctxt = NULL; /* safety */ |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@@ -267,16 +271,21 @@ static int stopread(sox_format_t * ft)
|
|
|
/* |
|
|
/* |
|
|
* add an audio output stream |
|
|
* add an audio output stream |
|
|
*/ |
|
|
*/ |
|
@ -32,7 +50,18 @@ |
|
|
{ |
|
|
{ |
|
|
AVCodecContext *c; |
|
|
AVCodecContext *c; |
|
|
AVStream *st; |
|
|
AVStream *st; |
|
|
@@ -306,7 +314,7 @@ static int open_audio(priv_t * ffmpeg, A
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- st = av_new_stream(oc, 1);
|
|
|
|
|
|
+ st = avformat_new_stream(oc, NULL);
|
|
|
|
|
|
if (!st) { |
|
|
|
|
|
lsx_fail("ffmpeg could not alloc stream"); |
|
|
|
|
|
return NULL; |
|
|
|
|
|
} |
|
|
|
|
|
+ st->id = 1;
|
|
|
|
|
|
|
|
|
|
|
|
c = st->codec; |
|
|
|
|
|
c->codec_id = codec_id; |
|
|
|
|
|
@@ -306,7 +315,7 @@ static int open_audio(priv_t * ffmpeg, A
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/* open it */ |
|
|
/* open it */ |
|
|