diff options
Diffstat (limited to 'softhddev.c')
-rw-r--r-- | softhddev.c | 19 |
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; |