summaryrefslogtreecommitdiffstats
path: root/test/test.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/test.c')
-rw-r--r--test/test.c27
1 files changed, 17 insertions, 10 deletions
diff --git a/test/test.c b/test/test.c
index dc66aa6f4..1d9781c49 100644
--- a/test/test.c
+++ b/test/test.c
@@ -10,7 +10,7 @@
#include <time.h>
#include <unistd.h>
-#include "hb.h"
+#include "mediafork.h"
/* Options */
static int debug = HB_DEBUG_NONE;
@@ -39,6 +39,7 @@ static int size = 0;
static int abitrate = 0;
static int mux = 0;
static int acodec = 0;
+static int pixelratio = 0;
static int chapter_start = 0;
static int chapter_end = 0;
static int crf = 0;
@@ -71,7 +72,7 @@ int main( int argc, char ** argv )
h = hb_init( debug, update );
/* Show version */
- fprintf( stderr, "HandBrake %s (%d) - http://handbrake.m0k.org/\n",
+ fprintf( stderr, "MediaFork %s (%d) - http://mediafork.dynalias.com/\n",
hb_get_version( h ), hb_get_build( h ) );
/* Check for update */
@@ -80,12 +81,12 @@ int main( int argc, char ** argv )
if( ( build = hb_check_update( h, &version ) ) > -1 )
{
fprintf( stderr, "You are using an old version of "
- "HandBrake.\nLatest is %s (build %d).\n", version,
+ "MediaFork.\nLatest is %s (build %d).\n", version,
build );
}
else
{
- fprintf( stderr, "Your version of HandBrake is up to "
+ fprintf( stderr, "Your version of MediaFork is up to "
"date.\n" );
}
hb_close( &h );
@@ -173,7 +174,7 @@ int main( int argc, char ** argv )
if( format ) free( format );
if( audios ) free( audios );
- fprintf( stderr, "HandBrake has exited.\n" );
+ fprintf( stderr, "MediaFork has exited.\n" );
return 0;
}
@@ -182,7 +183,7 @@ static void ShowCommands()
{
fprintf( stderr, "Commands:\n" );
fprintf( stderr, " [h]elp Show this message\n" );
- fprintf( stderr, " [q]uit Exit HBTest\n" );
+ fprintf( stderr, " [q]uit Exit MediaForkCLI\n" );
fprintf( stderr, " [p]ause Pause encoding\n" );
fprintf( stderr, " [r]esume Resume encoding\n" );
}
@@ -310,6 +311,7 @@ static int HandleEvents( hb_handle_t * h )
job->deinterlace = deinterlace;
job->grayscale = grayscale;
+ job->pixel_ratio = pixelratio;
if( width && height )
{
@@ -326,7 +328,7 @@ static int HandleEvents( hb_handle_t * h )
job->height = height;
hb_fix_aspect( job, HB_KEEP_HEIGHT );
}
- else
+ else if( !pixelratio )
{
hb_fix_aspect( job, HB_KEEP_WIDTH );
}
@@ -402,7 +404,7 @@ static int HandleEvents( hb_handle_t * h )
fprintf( stderr, "Calculated bitrate: %d kbps\n",
job->vbitrate );
}
-
+
if( sub )
{
job->subtitle = sub - 1;
@@ -506,7 +508,7 @@ static void ShowHelp()
int i;
fprintf( stderr,
- "Syntax: HBTest [options] -i <device> -o <file>\n"
+ "Syntax: MediaForkCLI [options] -i <device> -o <file>\n"
"\n"
" -h, --help Print help\n"
" -u, --update Check for updates and exit\n"
@@ -534,6 +536,7 @@ static void ShowHelp()
" -2, --two-pass Use two-pass mode\n"
" -d, --deinterlace Deinterlace video\n"
" -g, --grayscale Grayscale encoding\n"
+ " -p, --pixelratio Store pixel aspect ratio in video stream\n"
"\n"
" -r, --rate Set video framerate (" );
for( i = 0; i < hb_video_rates_count; i++ )
@@ -589,6 +592,7 @@ static int ParseOptions( int argc, char ** argv )
{ "two-pass", no_argument, NULL, '2' },
{ "deinterlace", no_argument, NULL, 'd' },
{ "grayscale", no_argument, NULL, 'g' },
+ { "pixelratio", no_argument, NULL, 'p' },
{ "width", required_argument, NULL, 'w' },
{ "height", required_argument, NULL, 'l' },
{ "crop", required_argument, NULL, 'n' },
@@ -608,7 +612,7 @@ static int ParseOptions( int argc, char ** argv )
int c;
c = getopt_long( argc, argv,
- "hvuC:f:i:o:t:c:a:s:e:E:2dgw:l:n:b:q:S:B:r:R:Q",
+ "hvuC:f:i:o:t:c:a:s:e:E:2dgpw:l:n:b:q:S:B:r:R:Q",
long_options, &option_index );
if( c < 0 )
{
@@ -680,6 +684,9 @@ static int ParseOptions( int argc, char ** argv )
case 'g':
grayscale = 1;
break;
+ case 'p':
+ pixelratio = 1;
+ break;
case 'e':
if( !strcasecmp( optarg, "ffmpeg" ) )
{