summaryrefslogtreecommitdiff
path: root/softhddev.c
diff options
context:
space:
mode:
authorJohns <johns98@gmx.net>2013-01-05 20:44:54 +0100
committerJohns <johns98@gmx.net>2013-01-05 20:44:54 +0100
commitfa09d940c57174c033ea4f65f61d32dda4e834bd (patch)
treea08d9c8c5fc48cc3aa9bba178157ea2e81a6acc8 /softhddev.c
parentd4702b9a9ec1774f546e91958f0752c0c45a632c (diff)
downloadvdr-plugin-softhddevice-fa09d940c57174c033ea4f65f61d32dda4e834bd.tar.gz
vdr-plugin-softhddevice-fa09d940c57174c033ea4f65f61d32dda4e834bd.tar.bz2
Fix PIP threading problems.
Diffstat (limited to 'softhddev.c')
-rw-r--r--softhddev.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/softhddev.c b/softhddev.c
index 102be69..fd51917 100644
--- a/softhddev.c
+++ b/softhddev.c
@@ -1518,6 +1518,11 @@ static void FixPacketForFFMpeg(VideoDecoder * vdecoder, AVPacket * avpkt)
*/
int VideoPollInput(VideoStream * stream)
{
+ if (!stream->Decoder) { // closing
+ fprintf(stderr, "no decoder\n");
+ return -1;
+ }
+
if (stream->ClearBuffers) {
atomic_set(&stream->PacketsFilled, 0);
stream->PacketRead = stream->PacketWrite;
@@ -1549,6 +1554,11 @@ int VideoDecodeInput(VideoStream * stream)
AVPacket *avpkt;
int saved_size;
+ if (!stream->Decoder) { // closing
+ fprintf(stderr, "no decoder\n");
+ return -1;
+ }
+
if (stream->ClearBuffers) { // clear buffer request
atomic_set(&stream->PacketsFilled, 0);
stream->PacketRead = stream->PacketWrite;
@@ -2987,16 +2997,17 @@ void PipStop(void)
return;
}
+ if (PipVideoStream->HwDecoder) {
+ VideoDelHwDecoder(PipVideoStream->HwDecoder);
+ PipVideoStream->HwDecoder = NULL;
+ // FIXME: does CodecVideoClose call hw decoder?
+ }
if (PipVideoStream->Decoder) {
PipVideoStream->SkipStream = 1;
CodecVideoClose(PipVideoStream->Decoder);
CodecVideoDelDecoder(PipVideoStream->Decoder);
PipVideoStream->Decoder = NULL;
}
- if (PipVideoStream->HwDecoder) {
- VideoDelHwDecoder(PipVideoStream->HwDecoder);
- PipVideoStream->HwDecoder = NULL;
- }
VideoPacketExit(PipVideoStream);
PipVideoStream->NewStream = 1;