]> granicus.if.org Git - libx264/commitdiff
Fix lavf input with pipes and image sequences
authorDavid Conrad <lessen42@gmail.com>
Sun, 24 Jan 2010 02:05:25 +0000 (18:05 -0800)
committerFiona Glaser <fiona@x264.com>
Thu, 28 Jan 2010 17:01:06 +0000 (09:01 -0800)
x264 should now be able to encode from an image sequence using an image2-style formatted string (e.g. file%02d.jpg).

x264.c

diff --git a/x264.c b/x264.c
index 3a07bb3cac506dbd3dfac14d7bc32ff0e1116430..db3353689938c47a570987a501843811538f20b2 100644 (file)
--- a/x264.c
+++ b/x264.c
@@ -719,13 +719,11 @@ static int select_input( const char *demuxer, char *used_demuxer, char *filename
     if( b_regular )
     {
         FILE *f = fopen( filename, "r" );
-        if( !f )
+        if( f )
         {
-            fprintf( stderr, "x264 [error]: could not open input file `%s'\n", filename );
-            return -1;
+            b_regular = x264_is_regular_file( f );
+            fclose( f );
         }
-        b_regular = x264_is_regular_file( f );
-        fclose( f );
     }
     const char *module = b_auto ? ext : demuxer;
 
@@ -756,7 +754,7 @@ static int select_input( const char *demuxer, char *used_demuxer, char *filename
 #endif
 #ifdef LAVF_INPUT
         if( (b_auto || !strcasecmp( demuxer, "lavf" )) &&
-            (!b_regular || !lavf_input.open_file( filename, p_handle, info, opt )) )
+            !lavf_input.open_file( filename, p_handle, info, opt ) )
         {
             module = "lavf";
             b_auto = 0;