blob: d72aa04533ddd35bacdfb8e887573764be14d646 [file] [log] [blame]
Index: squeezeslave-1.1_p381/src/slimaudio/slimaudio_decoder.c
===================================================================
--- squeezeslave-1.1_p381.orig/src/slimaudio/slimaudio_decoder.c
+++ squeezeslave-1.1_p381/src/slimaudio/slimaudio_decoder.c
@@ -69,7 +69,6 @@ void av_lib_setup (void)
av_register_all();
DEBUGF("decoder_thread: av_register_all\n");
- avcodec_init();
avcodec_register_all();
DEBUGF("decoder_thread: avcodec_register_all\n");
Index: squeezeslave-1.1_p381/src/slimaudio/slimaudio_decoder_aac.c
===================================================================
--- squeezeslave-1.1_p381.orig/src/slimaudio/slimaudio_decoder_aac.c
+++ squeezeslave-1.1_p381/src/slimaudio/slimaudio_decoder_aac.c
@@ -47,6 +47,11 @@
#define AUDIO_INBUF_SIZE (AUDIO_CHUNK_SIZE*2)
+#ifndef AVCODEC_MAX_AUDIO_FRAME_SIZE
+#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
+#endif
+
+
int slimaudio_decoder_aac_init(slimaudio_t *audio)
{
av_lib_setup();
@@ -164,7 +169,7 @@ int slimaudio_decoder_aac_process(slimau
}
else
{
- AVIOCtx->is_streamed = 1;
+ AVIOCtx->seekable = 0;
}
AVInputFormat* pAVInputFormat = av_find_input_format(streamformat);
@@ -199,7 +204,7 @@ int slimaudio_decoder_aac_process(slimau
}
else
{
- iRC = av_find_stream_info(pFormatCtx);
+ iRC = avformat_find_stream_info(pFormatCtx, NULL);
if ( iRC < 0 )
{
DEBUGF("aac: find stream info failed:%d\n", iRC);
@@ -236,7 +241,7 @@ int slimaudio_decoder_aac_process(slimau
}
/* Open codec */
- iRC = avcodec_open(pCodecCtx, pCodec);
+ iRC = avcodec_open2(pCodecCtx, pCodec, NULL);
if ( iRC < 0)
{
DEBUGF("aac: could not open codec:%d\n", iRC);
@@ -274,7 +279,7 @@ int slimaudio_decoder_aac_process(slimau
eos=true;
}
- if ( url_ferror(pFormatCtx->pb) )
+ if ( pFormatCtx->pb && pFormatCtx->pb->error )
{
DEBUGF("aac: url_ferror\n");
#if 0
@@ -312,7 +317,7 @@ int slimaudio_decoder_aac_process(slimau
/* Close the stream */
DEBUGF ("aac: av_close_input_stream\n");
- av_close_input_stream(pFormatCtx);
+ avformat_close_input(&pFormatCtx);
return 0;
}
Index: squeezeslave-1.1_p381/src/slimaudio/slimaudio_decoder_wma.c
===================================================================
--- squeezeslave-1.1_p381.orig/src/slimaudio/slimaudio_decoder_wma.c
+++ squeezeslave-1.1_p381/src/slimaudio/slimaudio_decoder_wma.c
@@ -47,6 +47,10 @@
#define AUDIO_INBUF_SIZE (AUDIO_CHUNK_SIZE*2)
+#ifndef AVCODEC_MAX_AUDIO_FRAME_SIZE
+#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
+#endif
+
int slimaudio_decoder_wma_init(slimaudio_t *audio)
{
av_lib_setup();
@@ -159,7 +163,7 @@ int slimaudio_decoder_wma_process(slimau
}
else
{
- AVIOCtx->is_streamed = 1;
+ AVIOCtx->seekable = 1;
}
AVInputFormat* pAVInputFormat = av_find_input_format(streamformat);
@@ -194,7 +198,7 @@ int slimaudio_decoder_wma_process(slimau
}
else
{
- iRC = av_find_stream_info(pFormatCtx);
+ iRC = avformat_find_stream_info(pFormatCtx,NULL);
if ( iRC < 0 )
{
DEBUGF("wma: find stream info failed:%d\n", iRC);
@@ -231,7 +235,7 @@ int slimaudio_decoder_wma_process(slimau
}
/* Open codec */
- iRC = avcodec_open(pCodecCtx, pCodec);
+ iRC = avcodec_open2(pCodecCtx, pCodec, NULL);
if ( iRC < 0)
{
DEBUGF("wma: could not open codec:%d\n", iRC);
@@ -270,7 +274,7 @@ int slimaudio_decoder_wma_process(slimau
eos=true;
}
- if ( url_ferror(pFormatCtx->pb) )
+ if ( pFormatCtx->pb && pFormatCtx->pb->error )
{
DEBUGF("wma: url_ferror\n");
#if 0
@@ -308,7 +312,7 @@ int slimaudio_decoder_wma_process(slimau
/* Close the stream */
DEBUGF ("wma: av_close_input_stream\n");
- av_close_input_stream(pFormatCtx);
+ avformat_close_input(&pFormatCtx);
return 0;
}