Clear buffers quicker, when replay stops.

This commit is contained in:
Johns 2013-02-08 21:03:06 +01:00
parent d4535a34c9
commit d31ff55b12

View File

@ -1801,10 +1801,13 @@ int VideoDecodeInput(VideoStream * stream)
if (!filled) { if (!filled) {
return -1; return -1;
} }
#if 0
// clearing for normal channel switch has no advantage // clearing for normal channel switch has no advantage
if (stream->ClearClose /*|| stream->ClosingStream */ ) { if (stream->ClearClose /*|| stream->ClosingStream */ ) {
int f; int f;
// FIXME: during replay all packets are always checked
// flush buffers, if close is in the queue // flush buffers, if close is in the queue
for (f = 0; f < filled; ++f) { for (f = 0; f < filled; ++f) {
avpkt = avpkt =
@ -1822,6 +1825,8 @@ int VideoDecodeInput(VideoStream * stream)
} }
stream->ClosingStream = 0; stream->ClosingStream = 0;
} }
#endif
// //
// handle queued commands // handle queued commands
// //
@ -2346,6 +2351,10 @@ int SetPlayMode(int play_mode)
{ {
VideoDisplayWakeup(); VideoDisplayWakeup();
if (MyVideoStream->Decoder) { // tell video parser we have new stream if (MyVideoStream->Decoder) { // tell video parser we have new stream
if (MyVideoStream->ClearClose) { // replay clear buffers on close
Clear(); // flush all buffers
MyVideoStream->ClearClose = 0;
}
if (MyVideoStream->CodecID != CODEC_ID_NONE) { if (MyVideoStream->CodecID != CODEC_ID_NONE) {
MyVideoStream->NewStream = 1; MyVideoStream->NewStream = 1;
// tell hw decoder we are closing stream // tell hw decoder we are closing stream