summaryrefslogtreecommitdiffstats
path: root/libhb/scan.c
diff options
context:
space:
mode:
authorjstebbins <[email protected]>2011-10-17 16:24:24 +0000
committerjstebbins <[email protected]>2011-10-17 16:24:24 +0000
commit1c0ae631e0898549b16b029e55e4526040872d5d (patch)
tree78ed68c3259db2f6af5b78ba43d26a3e2b477051 /libhb/scan.c
parent49fad04f4365f0c3c01583dabd8d261ec76505f3 (diff)
fix a problem with resolution changes in h.264
First, the scaling code in decavcodec.c was broken and didn't properly compensate for frames that had a different resolution than the rest of the stream. Second, libav can not handle resolution changes when doing frame based multi-threading. So disable threading when resolution changes are detected. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4295 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'libhb/scan.c')
-rw-r--r--libhb/scan.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/libhb/scan.c b/libhb/scan.c
index 29547bc9b..df20d2069 100644
--- a/libhb/scan.c
+++ b/libhb/scan.c
@@ -468,6 +468,22 @@ static void most_common_info( info_list_t *info_list, hb_work_info_t *info )
*info = info_list[biggest].info;
}
+static int has_resolution_change( info_list_t *info_list )
+{
+ int w, h, i;
+
+ if( !info_list[0].count )
+ return 0;
+ w = info_list[0].info.width;
+ h = info_list[0].info.height;
+ for ( i = 1; info_list[i].count; ++i )
+ {
+ if ( w != info_list[i].info.width || h != info_list[i].info.height )
+ return 1;
+ }
+ return 0;
+}
+
static int is_close_to( int val, int target, int thresh )
{
int diff = val - target;
@@ -819,6 +835,7 @@ skip_preview:
hb_work_info_t vid_info;
most_common_info( info_list, &vid_info );
+ title->has_resolution_change = has_resolution_change( info_list );
if ( title->video_codec_name == NULL )
{
title->video_codec_name = strdup( vid_info.name );