mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 00:14:06 +00:00
FFmpeg player: Fix some crashes on broken files
This commit is contained in:
parent
80a57ba344
commit
966f4a8b78
|
@ -51,7 +51,9 @@ AudioService & AudioService::instance()
|
|||
|
||||
AudioService::AudioService()
|
||||
{
|
||||
#if LIBAVFORMAT_VERSION_MAJOR < 58 || ( LIBAVFORMAT_VERSION_MAJOR == 58 && LIBAVFORMAT_VERSION_MINOR < 9 )
|
||||
av_register_all();
|
||||
#endif
|
||||
ao_initialize();
|
||||
}
|
||||
|
||||
|
@ -438,6 +440,8 @@ bool DecoderContext::play( QString & errorString )
|
|||
#else
|
||||
/* flush the decoder */
|
||||
av_init_packet( &packet );
|
||||
packet.data = NULL;
|
||||
packet.size = 0;
|
||||
int ret = avcodec_send_packet(codecContext_, &packet );
|
||||
while( ret >= 0 )
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue