mirror of
https://projects.vdr-developer.org/git/vdr-plugin-softhddevice.git
synced 2023-10-10 19:16:51 +02:00
Fix bug: close codec missing.
This commit is contained in:
parent
0fad02285d
commit
1969b2a0a7
4
codec.c
4
codec.c
@ -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);
|
Debug(3, "codec: using codec %s or ID %#04x\n", name, codec_id);
|
||||||
|
|
||||||
|
if ( decoder->VideoCtx ) {
|
||||||
|
Error(_("codec: missing close\n"));
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// ffmpeg compatibility hack
|
// ffmpeg compatibility hack
|
||||||
//
|
//
|
||||||
|
12
softhddev.c
12
softhddev.c
@ -389,6 +389,7 @@ static void VideoPacketInit(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
atomic_set(&VideoPacketsFilled, 0);
|
atomic_set(&VideoPacketsFilled, 0);
|
||||||
|
VideoPacketRead = VideoPacketWrite = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -461,11 +462,11 @@ static void VideoNextPacket(int codec_id)
|
|||||||
|
|
||||||
avpkt = &VideoPacketRb[VideoPacketWrite];
|
avpkt = &VideoPacketRb[VideoPacketWrite];
|
||||||
if (!avpkt->stream_index) { // ignore empty packets
|
if (!avpkt->stream_index) { // ignore empty packets
|
||||||
if (codec_id == CODEC_ID_NONE) {
|
if (codec_id != CODEC_ID_NONE) {
|
||||||
Debug(3, "video: possible stream change loss\n");
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Debug(3, "video: possible stream change loss\n");
|
||||||
|
}
|
||||||
|
|
||||||
if (atomic_read(&VideoPacketsFilled) >= VIDEO_PACKET_MAX - 1) {
|
if (atomic_read(&VideoPacketsFilled) >= VIDEO_PACKET_MAX - 1) {
|
||||||
// no free slot available drop last packet
|
// no free slot available drop last packet
|
||||||
@ -478,6 +479,7 @@ static void VideoNextPacket(int codec_id)
|
|||||||
}
|
}
|
||||||
// clear area for decoder, always enough space allocated
|
// clear area for decoder, always enough space allocated
|
||||||
memset(avpkt->data + avpkt->stream_index, 0, FF_INPUT_BUFFER_PADDING_SIZE);
|
memset(avpkt->data + avpkt->stream_index, 0, FF_INPUT_BUFFER_PADDING_SIZE);
|
||||||
|
|
||||||
avpkt->priv = (void *)(size_t) codec_id;
|
avpkt->priv = (void *)(size_t) codec_id;
|
||||||
|
|
||||||
// advance packet write
|
// advance packet write
|
||||||
@ -540,8 +542,8 @@ int VideoDecode(void)
|
|||||||
CodecVideoClose(MyVideoDecoder);
|
CodecVideoClose(MyVideoDecoder);
|
||||||
goto skip;
|
goto skip;
|
||||||
}
|
}
|
||||||
|
// size can be zero
|
||||||
goto skip;
|
goto skip;
|
||||||
break;
|
|
||||||
case CODEC_ID_MPEG2VIDEO:
|
case CODEC_ID_MPEG2VIDEO:
|
||||||
if (last_codec_id != CODEC_ID_MPEG2VIDEO) {
|
if (last_codec_id != CODEC_ID_MPEG2VIDEO) {
|
||||||
last_codec_id = CODEC_ID_MPEG2VIDEO;
|
last_codec_id = CODEC_ID_MPEG2VIDEO;
|
||||||
@ -619,7 +621,7 @@ static void StopVideo(void)
|
|||||||
}
|
}
|
||||||
VideoPacketExit();
|
VideoPacketExit();
|
||||||
|
|
||||||
NewVideoStream = 0;
|
NewVideoStream = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
Loading…
Reference in New Issue
Block a user