[x264-devel] Fix y4m input with C420paldv colorspace
Anton Mitrofanov
git at videolan.org
Tue Apr 23 23:03:04 CEST 2013
x264 | branch: master | Anton Mitrofanov <BugMaster at narod.ru> | Tue Mar 26 19:54:36 2013 +0400| [5980580d5a4d32eebf32b2f274807dd4aa68836b] | committer: Jason Garrett-Glaser
Fix y4m input with C420paldv colorspace
> http://git.videolan.org/gitweb.cgi/x264.git/?a=commit;h=5980580d5a4d32eebf32b2f274807dd4aa68836b
---
input/y4m.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/input/y4m.c b/input/y4m.c
index 009afa6..014450c 100644
--- a/input/y4m.c
+++ b/input/y4m.c
@@ -46,7 +46,6 @@ typedef struct
static int parse_csp_and_depth( char *csp_name, int *bit_depth )
{
int csp = X264_CSP_MAX;
- *bit_depth = 8;
/* Set colorspace from known variants */
if( !strncmp( "420", csp_name, 3 ) )
@@ -57,8 +56,8 @@ static int parse_csp_and_depth( char *csp_name, int *bit_depth )
csp = X264_CSP_I444;
/* Set high bit depth from known extensions */
- if( !strncmp( "p", csp_name + 3, 1 ) )
- *bit_depth = strtol( csp_name + 4, NULL, 10 );
+ if( sscanf( csp_name, "%*d%*[pP]%d", bit_depth ) != 1 )
+ *bit_depth = 8;
return csp;
}
More information about the x264-devel
mailing list