[FFmpeg-devel] [PATCH 1/2] avformat/matroskadec: set aspect ratio only when DisplayWidth and DisplayHeight are in pixels
Nicolas George
george at nsup.org
Sun Oct 16 20:01:34 EEST 2016
Le quintidi 25 vendémiaire, an CCXXV, James Almer a écrit :
> > Nothing probably, just me not giving it much thought after i couldn't find
> > any sample using cm, in or dar instead of pixels, and assuming the
> > calculations were tailored specifically for sizes in pixels.
> > I manually created some and you're right it seems to work fine with all of
> > them.
> >
> > Is the attached patch ok?
> > Subject: [PATCH] Partially revert "avformat/matroskadec: set aspect ratio only
> > when DisplayWidth and DisplayHeight are in pixels"
> >
> > The code works just fine regardless of unit, so only make sure DisplayUnit
> > is not "unknown".
> > - if (track->video.display_unit == MATROSKA_VIDEO_DISPLAYUNIT_PIXELS) {
> > + if (track->video.display_unit != MATROSKA_VIDEO_DISPLAYUNIT_UNKNOWN) {
>
> Alternatively, i could make it check for "less than" rather than "not equal",
> since values that are not defined (5 and above) should be ignored as they are,
> as per the spec guidelines, "unknown".
The logic seems fine, and a range comparison is probably better indeed.
By the way, in this spec:
https://www.matroska.org/technical/specs/index.html
I only see values 0-3, not 4 for unknown. Is there a more authoritative
version of the spec?
Regards,
--
Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20161016/a252ed85/attachment.sig>
More information about the ffmpeg-devel
mailing list