From 90ed02302e3ba670685f06efd85c7e642c6ce8cf Mon Sep 17 00:00:00 2001 From: Christopher Snowhill Date: Sun, 20 Feb 2022 03:14:10 -0800 Subject: [PATCH] Fix FFmpeg handling odd WMA files, at least This small change brings the decoding more in line with what ffplay does, and allows, for example, John McLaughlin.wma to play without interruption from the stream warnings throughout the file. Signed-off-by: Christopher Snowhill --- Plugins/FFMPEG/FFMPEGDecoder.m | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/Plugins/FFMPEG/FFMPEGDecoder.m b/Plugins/FFMPEG/FFMPEGDecoder.m index c2132a1a7..ffe181081 100644 --- a/Plugins/FFMPEG/FFMPEGDecoder.m +++ b/Plugins/FFMPEG/FFMPEGDecoder.m @@ -694,14 +694,8 @@ static uint8_t reverse_bits[0x100]; if(!rawDSD) { if((errcode = avcodec_send_packet(codecCtx, endOfStream ? NULL : lastReadPacket)) < 0) { - if(errcode == AVERROR_INVALIDDATA) { - ALog(@"Sync error sending packet to codec, attempting to skip it"); + if(errcode == AVERROR(EAGAIN)) { continue; - } else if(errcode != AVERROR(EAGAIN)) { - char errDescr[4096]; - av_strerror(errcode, errDescr, 4096); - ALog(@"Error sending packet to codec, errcode = %d, error = %s", errcode, errDescr); - return 0; } } }