mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-27 06:33:21 -05:00
Fix ffmpeg API breakage
avcodec_audio_decode() has been removed in favor of avcodec_decode_audio2(); output buffer size must be passed to the function.
This commit is contained in:
parent
888bf11d2f
commit
081a13bbea
@ -310,7 +310,7 @@ int ssc_ffmpeg_close(void *vp) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int _ssc_ffmpeg_read_frame(void *vp, char *buffer, int len) {
|
int _ssc_ffmpeg_read_frame(void *vp, char *buffer, int buflen) {
|
||||||
SSCHANDLE *handle = (SSCHANDLE *)vp;
|
SSCHANDLE *handle = (SSCHANDLE *)vp;
|
||||||
int data_size;
|
int data_size;
|
||||||
int len1;
|
int len1;
|
||||||
@ -329,11 +329,12 @@ int _ssc_ffmpeg_read_frame(void *vp, char *buffer, int len) {
|
|||||||
|
|
||||||
if(!handle->file_bytes_read)
|
if(!handle->file_bytes_read)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
len1 = avcodec_decode_audio(handle->pCodecCtx,(short*)buffer,
|
out_size = buflen;
|
||||||
&out_size,
|
len1 = avcodec_decode_audio2(handle->pCodecCtx,(short*)buffer,
|
||||||
(uint8_t*)handle->file_buffer_ptr,
|
&out_size,
|
||||||
handle->file_bytes_read);
|
(uint8_t*)handle->file_buffer_ptr,
|
||||||
|
handle->file_bytes_read);
|
||||||
|
|
||||||
if(len1 < 0) /* FIXME: Decode Error */
|
if(len1 < 0) /* FIXME: Decode Error */
|
||||||
return 0;
|
return 0;
|
||||||
@ -355,11 +356,12 @@ int _ssc_ffmpeg_read_frame(void *vp, char *buffer, int len) {
|
|||||||
|
|
||||||
while(1) {
|
while(1) {
|
||||||
while(handle->packet_size > 0) {
|
while(handle->packet_size > 0) {
|
||||||
len1=avcodec_decode_audio(handle->pCodecCtx,
|
data_size = buflen;
|
||||||
(int16_t*)buffer,
|
len1=avcodec_decode_audio2(handle->pCodecCtx,
|
||||||
&data_size,
|
(int16_t*)buffer,
|
||||||
handle->packet_data,
|
&data_size,
|
||||||
handle->packet_size);
|
handle->packet_data,
|
||||||
|
handle->packet_size);
|
||||||
|
|
||||||
if(len1 < 0) {
|
if(len1 < 0) {
|
||||||
/* skip frame */
|
/* skip frame */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user