[x264-devel] commit: Don't try to get timecodes if reading frame failed ( Anton Mitrofanov )
git at videolan.org
git at videolan.org
Tue Dec 7 09:15:49 CET 2010
x264 | branch: master | Anton Mitrofanov <BugMaster at narod.ru> | Sat Dec 4 23:29:08 2010 +0300| [2a59dfad21643a6635cd7a7ec4d4d00b0ce3d817] | committer: Jason Garrett-Glaser
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.
> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=2a59dfad21643a6635cd7a7ec4d4d00b0ce3d817
---
input/timecode.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/input/timecode.c b/input/timecode.c
index 3aea325..44f0ac3 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 )
More information about the x264-devel
mailing list