]> granicus.if.org Git - libx264/commitdiff
10l in r473 and stdin
authorLoren Merritt <pengvado@videolan.org>
Mon, 20 Mar 2006 23:32:43 +0000 (23:32 +0000)
committerLoren Merritt <pengvado@videolan.org>
Mon, 20 Mar 2006 23:32:43 +0000 (23:32 +0000)
git-svn-id: svn://svn.videolan.org/x264/trunk@477 df754926-b1dd-0310-bc7b-ec298dee348c

muxers.c
x264.c

index 5bfb92453be129baee8a9cf0127fee704b9bfa3d..5fab68d885ff7f4cfb170177ec895091a3ec7df3 100644 (file)
--- a/muxers.c
+++ b/muxers.c
@@ -54,11 +54,16 @@ int open_file_yuv( char *psz_filename, hnd_t *p_handle, x264_param_t *p_param )
     yuv_input_t *h = malloc(sizeof(yuv_input_t));
     h->width = p_param->i_width;
     h->height = p_param->i_height;
-    h->fh = fopen(psz_filename, "rb");
     h->next_frame = 0;
-    *p_handle = (hnd_t)h;
+
+    if( !strcmp(psz_filename, "-") )
+        h->fh = stdin;
+    else
+        h->fh = fopen(psz_filename, "rb");
     if( h->fh == NULL )
         return -1;
+
+    *p_handle = (hnd_t)h;
     return 0;
 }
 
@@ -279,7 +284,7 @@ int read_frame_thread( x264_picture_t *p_pic, hnd_t handle, int i_frame )
         ret |= h->p_read_frame( p_pic, h->p_handle, i_frame );
     }
 
-    if( i_frame+1 < h->frame_total )
+    if( !h->frame_total || i_frame+1 < h->frame_total )
     {
         h->next_frame =
         h->next_args->i_frame = i_frame+1;
diff --git a/x264.c b/x264.c
index eb2776974cae20e76356dae80468c4ea44b32bdf..2ffcdfcb6e2db33b43d2bfc277d77decdf030328 100644 (file)
--- a/x264.c
+++ b/x264.c
@@ -956,12 +956,6 @@ static int  Parse( int argc, char **argv,
     }
 
     /* open the input */
-    if( !strcmp( psz_filename, "-" ) )
-    {
-        opt->hin = stdin;
-        optind++;
-    }
-    else
     {
         if( b_avis )
         {