From: Anton Mitrofanov Date: Sat, 4 Dec 2010 20:29:08 +0000 (+0300) Subject: Don't try to get timecodes if reading frame failed X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;ds=sidebyside;h=90fa32a09d2f126c8be53cd2331c8bbd3f44fcce;p=x264 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. --- 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 )