]> git.sesse.net Git - x264/commitdiff
Don't try to get timecodes if reading frame failed
authorAnton Mitrofanov <BugMaster@narod.ru>
Sat, 4 Dec 2010 20:29:08 +0000 (23:29 +0300)
committerFiona Glaser <fiona@x264.com>
Tue, 7 Dec 2010 02:56:57 +0000 (18:56 -0800)
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

index 3aea325558271d3d2c1e6421589ef0b74c7fefcc..44f0ac341f4d2d0dab7a99dc626b78806c9ed4ad 100644 (file)
@@ -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 )