diff options
author | Johns <johns98@gmx.net> | 2012-01-22 22:46:52 +0100 |
---|---|---|
committer | Johns <johns98@gmx.net> | 2012-01-22 22:46:52 +0100 |
commit | 1969b2a0a760c94e7b05aa209df4449545130a93 (patch) | |
tree | 43c28eebbb869512224438e8a728abe88040158d | |
parent | 0fad02285dd983bd22fb9795698e4c3c88d21038 (diff) | |
download | vdr-plugin-softhddevice-1969b2a0a760c94e7b05aa209df4449545130a93.tar.gz vdr-plugin-softhddevice-1969b2a0a760c94e7b05aa209df4449545130a93.tar.bz2 |
Fix bug: close codec missing.
-rw-r--r-- | codec.c | 4 | ||||
-rw-r--r-- | softhddev.c | 12 |
2 files changed, 11 insertions, 5 deletions
@@ -357,6 +357,10 @@ void CodecVideoOpen(VideoDecoder * decoder, const char *name, int codec_id) Debug(3, "codec: using codec %s or ID %#04x\n", name, codec_id); + if ( decoder->VideoCtx ) { + Error(_("codec: missing close\n")); + } + // // ffmpeg compatibility hack // diff --git a/softhddev.c b/softhddev.c index 649fcd3..102f9f1 100644 --- a/softhddev.c +++ b/softhddev.c @@ -389,6 +389,7 @@ static void VideoPacketInit(void) } atomic_set(&VideoPacketsFilled, 0); + VideoPacketRead = VideoPacketWrite = 0; } /** @@ -461,10 +462,10 @@ static void VideoNextPacket(int codec_id) avpkt = &VideoPacketRb[VideoPacketWrite]; if (!avpkt->stream_index) { // ignore empty packets - if (codec_id == CODEC_ID_NONE) { - Debug(3, "video: possible stream change loss\n"); + if (codec_id != CODEC_ID_NONE) { + return; } - return; + Debug(3, "video: possible stream change loss\n"); } if (atomic_read(&VideoPacketsFilled) >= VIDEO_PACKET_MAX - 1) { @@ -478,6 +479,7 @@ static void VideoNextPacket(int codec_id) } // clear area for decoder, always enough space allocated memset(avpkt->data + avpkt->stream_index, 0, FF_INPUT_BUFFER_PADDING_SIZE); + avpkt->priv = (void *)(size_t) codec_id; // advance packet write @@ -540,8 +542,8 @@ int VideoDecode(void) CodecVideoClose(MyVideoDecoder); goto skip; } + // size can be zero goto skip; - break; case CODEC_ID_MPEG2VIDEO: if (last_codec_id != CODEC_ID_MPEG2VIDEO) { last_codec_id = CODEC_ID_MPEG2VIDEO; @@ -619,7 +621,7 @@ static void StopVideo(void) } VideoPacketExit(); - NewVideoStream = 0; + NewVideoStream = 1; } #ifdef DEBUG |