Commit 6bacda48 authored by Steve Lhomme's avatar Steve Lhomme

mkclean: correct DisplayUnit that appear to be in pixels but marked as Display Aspect Ratio (DAR)

git-svn-id: https://matroska.svn.sourceforge.net/svnroot/matroska/trunk/foundation_src@810 a6f86f6d-0131-4f8e-9e7b-e335508773d5
parent 59df0de7
2011-09-xx
version 0.8.6:
- correct DisplayUnit that appear to be in pixels but marked as Display Aspect Ratio (DAR)
2011-08-15
version 0.8.5:
- fix the recompression of the CodecPrivate through successive mkclean calls
......
......@@ -970,6 +970,15 @@ static int CleanTracks(ebml_master *Tracks, int SrcProfile, int *DstProfile, ebm
if (DisplayW || DisplayH)
{
Elt2 = EBML_MasterFindChild((ebml_master*)Elt,&MATROSKA_ContextDisplayUnit);
if (Elt2 && EBML_IntegerValue((ebml_integer*)Elt2)==MATROSKA_DISPLAY_UNIT_DAR)
{
// if the output size appears in pixel, fix it
if ((!DisplayW || Width==EBML_IntegerValue((ebml_integer*)DisplayW)) && (!DisplayH || Height==EBML_IntegerValue((ebml_integer*)DisplayH)))
EBML_IntegerSetValue((ebml_integer*)Elt2, MATROSKA_DISPLAY_UNIT_PIXEL);
else
CleanCropValues((ebml_master*)Elt, 0, 0);
}
if (!Elt2 || EBML_IntegerValue((ebml_integer*)Elt2)==MATROSKA_DISPLAY_UNIT_PIXEL) // pixel AR
{
if (!DisplayW)
......@@ -1062,9 +1071,7 @@ static int CleanTracks(ebml_master *Tracks, int SrcProfile, int *DstProfile, ebm
}
}
Elt2 = EBML_MasterGetChild((ebml_master*)Elt,&MATROSKA_ContextDisplayUnit);
if (EBML_IntegerValue((ebml_integer*)Elt2)==MATROSKA_DISPLAY_UNIT_DAR)
CleanCropValues((ebml_master*)Elt, 0, 0);
else
if (EBML_IntegerValue((ebml_integer*)Elt2)!=MATROSKA_DISPLAY_UNIT_DAR)
CleanCropValues((ebml_master*)Elt, DisplayW?EBML_IntegerValue((ebml_integer*)DisplayW):Width, DisplayH?EBML_IntegerValue((ebml_integer*)DisplayH):Height);
}
......
......@@ -3,7 +3,7 @@
GROUP mkclean_base
{
PROJECT_NAME "mkclean"
PROJECT_VERSION 0.8.5
PROJECT_VERSION 0.8.6
PROJECT_VENDOR "Matroska"
USE matroska2
IF !CONFIG_EBML_UNICODE
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment