Fixed ATTA and DETA

Cleanup some code
Testet GRAB funktions
This commit is contained in:
jojo61
2019-10-20 14:48:28 +02:00
parent 40115f4fc6
commit f80d757704
4 changed files with 309 additions and 533 deletions

12
codec.c
View File

@@ -439,17 +439,19 @@ void CodecVideoOpen(VideoDecoder * decoder, int codec_id)
*/
void CodecVideoClose(VideoDecoder *video_decoder)
{
AVFrame *frame;
// FIXME: play buffered data
// av_frame_free(&video_decoder->Frame); // callee does checks
Debug(3,"CodecVideoClose\n");
if (video_decoder->VideoCtx) {
pthread_mutex_lock(&CodecLockMutex);
// avcodec_send_packet(video_ctx, NULL);
// while (avcodec_receive_frame(video_ctx,video_decoder->Frame) >= 0);
#if 1
frame = av_frame_alloc();
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);
av_freep(&video_decoder->VideoCtx);
pthread_mutex_unlock(&CodecLockMutex);