mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 04:24:09 +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()
|
AudioService::AudioService()
|
||||||
{
|
{
|
||||||
|
#if LIBAVFORMAT_VERSION_MAJOR < 58 || ( LIBAVFORMAT_VERSION_MAJOR == 58 && LIBAVFORMAT_VERSION_MINOR < 9 )
|
||||||
av_register_all();
|
av_register_all();
|
||||||
|
#endif
|
||||||
ao_initialize();
|
ao_initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -438,6 +440,8 @@ bool DecoderContext::play( QString & errorString )
|
||||||
#else
|
#else
|
||||||
/* flush the decoder */
|
/* flush the decoder */
|
||||||
av_init_packet( &packet );
|
av_init_packet( &packet );
|
||||||
|
packet.data = NULL;
|
||||||
|
packet.size = 0;
|
||||||
int ret = avcodec_send_packet(codecContext_, &packet );
|
int ret = avcodec_send_packet(codecContext_, &packet );
|
||||||
while( ret >= 0 )
|
while( ret >= 0 )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue