Changeset 705

Show
Ignore:
Timestamp:
09/25/07 16:05:12 (2 years ago)
Author:
astrange
Message:

Write reduced fractions for clean-aperture in MKV.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/MatroskaImportPrivate.cpp

    r671 r705  
    4848#include "Codecprintf.h" 
    4949#include "bitstream_info.h" 
     50 
     51extern "C" { 
     52#include "avutil.h" 
     53} 
    5054 
    5155using namespace std; 
     
    384388} 
    385389 
     390static void SetCleanApertureDimensions(CleanApertureImageDescriptionExtension **clap, Fixed cleanW, Fixed cleanH) 
     391{ 
     392        int wN, wD, hN, hD; 
     393         
     394        av_reduce(&wN, &wD, cleanW, fixed1, UINT_MAX); 
     395        av_reduce(&hN, &hD, cleanH, fixed1, UINT_MAX); 
     396         
     397        **clap = (CleanApertureImageDescriptionExtension){EndianU32_NtoB(wN), EndianU32_NtoB(wD), 
     398                                                                                                          EndianU32_NtoB(hN), EndianU32_NtoB(hD), 
     399                                                                                                          EndianU32_NtoB(0), EndianU32_NtoB(1), EndianU32_NtoB(0), EndianU32_NtoB(1)}; 
     400} 
     401 
    386402ComponentResult MatroskaImport::AddVideoTrack(KaxTrackEntry &kaxTrack, MatroskaTrack &mkvTrack) 
    387403{ 
     
    422438        } 
    423439         
    424         **clap = (CleanApertureImageDescriptionExtension){EndianU32_NtoB(width), EndianU32_NtoB(fixed1), 
    425                                                                                                           EndianU32_NtoB(height), EndianU32_NtoB(fixed1), 
    426                                                                                                           EndianU32_NtoB(0), EndianU32_NtoB(1), EndianU32_NtoB(0), EndianU32_NtoB(1)}; 
    427  
     440        SetCleanApertureDimensions(clap, width, height); 
     441         
    428442        mkvTrack.theTrack = NewMovieTrack(theMovie, width, height, kNoVolume); 
    429443        if (mkvTrack.theTrack == NULL)