summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2010-04-08 20:43:49 +0000
committerjstebbins <[email protected]>2010-04-08 20:43:49 +0000
commite000068fb6edc94e6df0016407f6123f8663b3d0 (patch)
tree8ec9b3fac8995ec33fb8cb06082a95fefb210d4a
parent3f0d1475e525b620ef1742ea525edd13ad75459d (diff)
CLI: add single title scan support
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3207 b64f7644-9d1e-0410-96f1-a4d463321fa5
-rw-r--r--test/test.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/test/test.c b/test/test.c
index 015e13da4..4cd8c5c42 100644
--- a/test/test.c
+++ b/test/test.c
@@ -37,6 +37,7 @@ static char * input = NULL;
static char * output = NULL;
static char * format = NULL;
static int titleindex = 1;
+static int titlescan = 0;
static int longest_title = 0;
static char * native_language = NULL;
static int native_dub = 0;
@@ -482,7 +483,7 @@ static int HandleEvents( hb_handle_t * h )
case HB_STATE_SCANNING:
/* Show what title is currently being scanned */
fprintf( stderr, "Scanning title %d", p.title_cur );
- if( !titleindex )
+ if( !titleindex || titlescan )
fprintf( stderr, " of %d", p.title_count );
fprintf( stderr, "...\n" );
break;
@@ -551,7 +552,7 @@ static int HandleEvents( hb_handle_t * h )
title = hb_list_item( list, 0 );
}
- if( !titleindex )
+ if( !titleindex || titlescan )
{
/* Scan-only mode, print infos and exit */
int i;
@@ -2199,8 +2200,9 @@ static void ShowHelp()
"### Source Options-----------------------------------------------------------\n\n"
" -i, --input <string> Set input device\n"
- " -t, --title <number> Select a title to encode (0 to scan only,\n"
+ " -t, --title <number> Select a title to encode (0 to scan all titles only,\n"
" default: 1)\n"
+ " --scan Scan selected title only.\n"
" -L, --longest Select the longest title\n"
" -c, --chapters <string> Select chapters (e.g. \"1-3\" for chapters\n"
" 1 to 3, or \"3\" for chapter 3 only,\n"
@@ -2532,6 +2534,7 @@ static int ParseOptions( int argc, char ** argv )
#define SRT_LANG 273
#define SRT_DEFAULT 274
#define ROTATE_FILTER 275
+ #define SCAN_ONLY 276
for( ;; )
{
@@ -2551,6 +2554,7 @@ static int ParseOptions( int argc, char ** argv )
{ "ipod-atom", no_argument, NULL, 'I' },
{ "title", required_argument, NULL, 't' },
+ { "scan", no_argument, NULL, SCAN_ONLY },
{ "longest", no_argument, NULL, 'L' },
{ "chapters", required_argument, NULL, 'c' },
{ "angle", required_argument, NULL, ANGLE },
@@ -2698,6 +2702,9 @@ static int ParseOptions( int argc, char ** argv )
case 't':
titleindex = atoi( optarg );
break;
+ case SCAN_ONLY:
+ titlescan = 1;
+ break;
case 'L':
longest_title = 1;
break;
@@ -3096,7 +3103,7 @@ static int CheckOptions( int argc, char ** argv )
}
/* Parse format */
- if( titleindex > 0 )
+ if( titleindex > 0 && !titlescan )
{
if( output == NULL || *output == '\0' )
{