diff options
author | Johns <johns98@gmx.net> | 2013-07-15 17:00:22 +0200 |
---|---|---|
committer | Johns <johns98@gmx.net> | 2013-07-15 17:00:22 +0200 |
commit | cc1e2de58ba213d79f20ad4d80609ede45470edc (patch) | |
tree | 40b1e100e9f302cea7ae076e8b110a36a2f2846c /softhddev.c | |
parent | 738e9402d2e8e97b94dd76cd740aa6da8970da2d (diff) | |
download | vdr-plugin-softhddevice-cc1e2de58ba213d79f20ad4d80609ede45470edc.tar.gz vdr-plugin-softhddevice-cc1e2de58ba213d79f20ad4d80609ede45470edc.tar.bz2 |
Reduce PES error messages.
Diffstat (limited to 'softhddev.c')
-rw-r--r-- | softhddev.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/softhddev.c b/softhddev.c index 9ce0c7c..de3c5d7 100644 --- a/softhddev.c +++ b/softhddev.c @@ -1316,6 +1316,8 @@ struct __video_stream__ volatile char ClearBuffers; ///< command clear video buffers volatile char ClearClose; ///< clear video buffers for close + int InvalidPesCounter; ///< counter of invalid PES packets + AVPacket PacketRb[VIDEO_PACKET_MAX]; ///< PES packet ring buffer int StartCodeState; ///< last three bytes start code state @@ -1756,6 +1758,7 @@ static void VideoStreamClose(VideoStream * stream) VideoPacketExit(stream); stream->NewStream = 1; + stream->InvalidPesCounter = 0; } /** @@ -2012,6 +2015,7 @@ static void StopVideo(void) VideoPacketExit(MyVideoStream); MyVideoStream->NewStream = 1; + MyVideoStream->InvalidPesCounter = 0; } #ifdef DEBUG @@ -2141,9 +2145,18 @@ int PlayVideo3(VideoStream * stream, const uint8_t * data, int size) // must be a PES start code // FIXME: Valgrind-3.8.1 has a problem with this code if (size < 9 || !data || data[0] || data[1] || data[2] != 0x01) { - Error(_("[softhddev] invalid PES video packet\n")); + if (!stream->InvalidPesCounter++) { + Error(_("[softhddev] invalid PES video packet\n")); + } return size; } + if (stream->InvalidPesCounter) { + if (stream->InvalidPesCounter > 1) { + Error(_("[softhddev] %d invalid PES video packet(s)\n"), + stream->InvalidPesCounter); + } + stream->InvalidPesCounter = 0; + } // 0xBE, filler, padding stream if (data[3] == PES_PADDING_STREAM) { // from DVD plugin return size; @@ -2410,6 +2423,7 @@ int SetPlayMode(int play_mode) } if (MyVideoStream->CodecID != CODEC_ID_NONE) { MyVideoStream->NewStream = 1; + MyVideoStream->InvalidPesCounter = 0; // tell hw decoder we are closing stream VideoSetClosing(MyVideoStream->HwDecoder); VideoResetStart(MyVideoStream->HwDecoder); @@ -3426,6 +3440,7 @@ void PipStop(void) VideoPacketExit(PipVideoStream); PipVideoStream->NewStream = 1; + PipVideoStream->InvalidPesCounter = 0; #else PipVideoStream->Close = 1; for (i = 0; PipVideoStream->Close && i < 50; ++i) { |