mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 08:44:19 -04:00
ffmpeg: Use avcodec_flush_buffers
when seeking
Previously this would close and reopen the codec context; that's entirely unnecessary, as all supported versions of libavcodec support flushing the buffers instead.
This commit is contained in:
parent
e430428703
commit
8d36908556
@ -437,16 +437,7 @@ seek(double t) {
|
||||
cleanup();
|
||||
return;
|
||||
}
|
||||
avcodec_close(_audio_ctx);
|
||||
AVCodec *pAudioCodec = avcodec_find_decoder(_audio_ctx->codec_id);
|
||||
if(pAudioCodec == 0) {
|
||||
cleanup();
|
||||
return;
|
||||
}
|
||||
if (avcodec_open2(_audio_ctx, pAudioCodec, NULL) < 0) {
|
||||
cleanup();
|
||||
return;
|
||||
}
|
||||
avcodec_flush_buffers(_audio_ctx);
|
||||
_buffer_head = 0;
|
||||
_buffer_tail = 0;
|
||||
fetch_packet();
|
||||
|
Loading…
x
Reference in New Issue
Block a user