libff: Improved handling of EOF in the decoder threads
(Also modifies obs-ffmpeg to handle empty frames on EOF) Previously the demuxer could hit EOF before the decoder threads are finished, resulting in truncated output. In the worse case scenario the demuxer could read small files before ff_decoder_refresh even has a chance to start the clocks, resulting in no output at all.
This commit is contained in:
@@ -269,7 +269,7 @@ static bool audio_frame(struct ff_frame *frame, void *opaque)
|
||||
uint64_t pts;
|
||||
|
||||
// Media ended
|
||||
if (frame == NULL)
|
||||
if (frame == NULL || frame->frame == NULL)
|
||||
return true;
|
||||
|
||||
pts = (uint64_t)(frame->pts * 1000000000.0L);
|
||||
|
Reference in New Issue
Block a user