From: Loren Merritt Date: Thu, 3 Aug 2006 18:22:08 +0000 (+0000) Subject: cli: don't try to get resolution from filename unless input is rawyuv X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=64a8b781013148bd351c2a45fdcb6a9aaf26ff4a;p=libx264 cli: don't try to get resolution from filename unless input is rawyuv git-svn-id: svn://svn.videolan.org/x264/trunk@549 df754926-b1dd-0310-bc7b-ec298dee348c --- diff --git a/x264.c b/x264.c index cdf3996b..1324c83f 100644 --- a/x264.c +++ b/x264.c @@ -60,7 +60,6 @@ static void SigIntHandler( int a ) } typedef struct { - int b_decompress; int b_progress; int i_seek; hnd_t hin; @@ -573,7 +572,16 @@ static int Parse( int argc, char **argv, } psz_filename = argv[optind++]; - if( !opt->b_decompress ) + /* check demuxer type */ + psz = psz_filename + strlen(psz_filename) - 1; + while( psz > psz_filename && *psz != '.' ) + psz--; + if( !strncasecmp( psz, ".avi", 4 ) || !strncasecmp( psz, ".avs", 4 ) ) + b_avis = 1; + if( !strncasecmp( psz, ".y4m", 4 ) ) + b_y4m = 1; + + if( !(b_avis || b_y4m) ) // raw yuv { if( optind > argc - 1 ) { @@ -593,21 +601,12 @@ static int Parse( int argc, char **argv, { sscanf( argv[optind++], "%ux%u", ¶m->i_width, ¶m->i_height ); } + } - /* check avis input */ - psz = psz_filename + strlen(psz_filename) - 1; - while( psz > psz_filename && *psz != '.' ) - psz--; - - if( !strncasecmp( psz, ".avi", 4 ) || !strncasecmp( psz, ".avs", 4 ) ) - b_avis = 1; - if( !strncasecmp( psz, ".y4m", 4 ) ) - b_y4m = 1; - if( !(b_avis || b_y4m) && ( !param->i_width || !param->i_height ) ) - { - Help( &defaults ); - return -1; - } + if( !(b_avis || b_y4m) && ( !param->i_width || !param->i_height ) ) + { + Help( &defaults ); + return -1; } /* open the input */