diff --git a/x264.c b/x264.c index 7d98518..bf2b3ee 100644 --- a/x264.c +++ b/x264.c @@ -933,9 +933,9 @@ static int select_output( const char *muxer, char *filename, x264_param_t *param static int select_input( const char *demuxer, char *used_demuxer, char *filename, hnd_t *p_handle, video_info_t *info, cli_input_opt_t *opt ) { - const char *ext = get_filename_extension( filename ); - int b_regular = strcmp( filename, "-" ); int b_auto = !strcasecmp( demuxer, "auto" ); + const char *ext = b_auto ? get_filename_extension( filename ) : ""; + int b_regular = strcmp( filename, "-" ); if( !b_regular && b_auto ) ext = "raw"; b_regular = b_regular && x264_is_regular_file_path( filename );