mirror of
https://github.com/jojo61/vdr-plugin-softhdcuvid.git
synced 2025-03-01 10:39:28 +00:00
Fixed ATTA and DETA
Cleanup some code Testet GRAB funktions
This commit is contained in:
3
audio.c
3
audio.c
@@ -1035,8 +1035,7 @@ static snd_pcm_t *AlsaOpenPCM(int passthrough)
|
|||||||
}
|
}
|
||||||
// open none blocking; if device is already used, we don't want wait
|
// open none blocking; if device is already used, we don't want wait
|
||||||
if ((err =
|
if ((err =
|
||||||
snd_pcm_open(&handle, device, SND_PCM_STREAM_PLAYBACK,
|
snd_pcm_open(&handle, device, SND_PCM_STREAM_PLAYBACK,SND_PCM_NONBLOCK)) < 0) {
|
||||||
SND_PCM_NONBLOCK)) < 0) {
|
|
||||||
Error(_("audio/alsa: playback open '%s' error: %s\n"), device, snd_strerror(err));
|
Error(_("audio/alsa: playback open '%s' error: %s\n"), device, snd_strerror(err));
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
12
codec.c
12
codec.c
@@ -439,17 +439,19 @@ void CodecVideoOpen(VideoDecoder * decoder, int codec_id)
|
|||||||
*/
|
*/
|
||||||
void CodecVideoClose(VideoDecoder *video_decoder)
|
void CodecVideoClose(VideoDecoder *video_decoder)
|
||||||
{
|
{
|
||||||
|
AVFrame *frame;
|
||||||
// FIXME: play buffered data
|
// FIXME: play buffered data
|
||||||
// av_frame_free(&video_decoder->Frame); // callee does checks
|
// av_frame_free(&video_decoder->Frame); // callee does checks
|
||||||
|
|
||||||
Debug(3,"CodecVideoClose\n");
|
Debug(3,"CodecVideoClose\n");
|
||||||
if (video_decoder->VideoCtx) {
|
if (video_decoder->VideoCtx) {
|
||||||
pthread_mutex_lock(&CodecLockMutex);
|
pthread_mutex_lock(&CodecLockMutex);
|
||||||
|
#if 1
|
||||||
// avcodec_send_packet(video_ctx, NULL);
|
frame = av_frame_alloc();
|
||||||
// while (avcodec_receive_frame(video_ctx,video_decoder->Frame) >= 0);
|
avcodec_send_packet(video_decoder->VideoCtx, NULL);
|
||||||
|
while (avcodec_receive_frame(video_decoder->VideoCtx,frame) >= 0);
|
||||||
|
av_frame_free(&frame);
|
||||||
|
#endif
|
||||||
avcodec_close(video_decoder->VideoCtx);
|
avcodec_close(video_decoder->VideoCtx);
|
||||||
av_freep(&video_decoder->VideoCtx);
|
av_freep(&video_decoder->VideoCtx);
|
||||||
pthread_mutex_unlock(&CodecLockMutex);
|
pthread_mutex_unlock(&CodecLockMutex);
|
||||||
|
@@ -1910,15 +1910,14 @@ int VideoDecodeInput(VideoStream * stream)
|
|||||||
}
|
}
|
||||||
#if 0
|
#if 0
|
||||||
// clearing for normal channel switch has no advantage
|
// clearing for normal channel switch has no advantage
|
||||||
if (stream->ClearClose /*|| stream->ClosingStream */ ) {
|
if (stream->ClearClose || stream->ClosingStream ) {
|
||||||
int f;
|
int f;
|
||||||
|
|
||||||
// FIXME: during replay all packets are always checked
|
// FIXME: during replay all packets are always checked
|
||||||
|
|
||||||
// flush buffers, if close is in the queue
|
// flush buffers, if close is in the queue
|
||||||
for (f = 0; f < filled; ++f) {
|
for (f = 0; f < filled; ++f) {
|
||||||
if (stream->CodecIDRb[(stream->PacketRead + f) % VIDEO_PACKET_MAX]
|
if (stream->CodecIDRb[(stream->PacketRead + f) % VIDEO_PACKET_MAX] == AV_CODEC_ID_NONE) {
|
||||||
== AV_CODEC_ID_NONE) {
|
|
||||||
if (f) {
|
if (f) {
|
||||||
Debug(3, "video: cleared upto close\n");
|
Debug(3, "video: cleared upto close\n");
|
||||||
atomic_sub(f, &stream->PacketsFilled);
|
atomic_sub(f, &stream->PacketsFilled);
|
||||||
|
Reference in New Issue
Block a user