From 90fa32a09d2f126c8be53cd2331c8bbd3f44fcce Mon Sep 17 00:00:00 2001 From: Anton Mitrofanov Date: Sat, 4 Dec 2010 23:29:08 +0300 Subject: [PATCH] Don't try to get timecodes if reading frame failed This fixes "input timecode file missing data for frame" warning with piped input where we don't know total number of frames. --- input/timecode.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/input/timecode.c b/input/timecode.c index 3aea3255..44f0ac34 100644 --- a/input/timecode.c +++ b/input/timecode.c @@ -410,12 +410,13 @@ static int64_t get_frame_pts( timecode_hnd_t *h, int frame, int real_frame ) static int read_frame( cli_pic_t *pic, hnd_t handle, int frame ) { timecode_hnd_t *h = handle; - int ret = h->input.read_frame( pic, h->p_handle, frame ); + if( h->input.read_frame( pic, h->p_handle, frame ) ) + return -1; pic->pts = get_frame_pts( h, frame, 1 ); pic->duration = get_frame_pts( h, frame + 1, 0 ) - pic->pts; - return ret; + return 0; } static int release_frame( cli_pic_t *pic, hnd_t handle ) -- 2.39.2