mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-23 14:36:24 +00:00
matroskademux: fix pixel-aspect-ratio if header has only one display variable
Current matroska demux calculates the pixel aspect ratio only if both DisplayHeight and DisplayWidth are set, but it is legal to use only one variable if the other is equal to PixelWidth or PixelHeight, at least the mkclean utility is doing that. So this makse mkcleaned files play correctly. https://bugzilla.gnome.org/show_bug.cgi?id=654744
This commit is contained in:
parent
df3cee6606
commit
69c14012c9
1 changed files with 6 additions and 2 deletions
|
@ -4873,16 +4873,20 @@ gst_matroska_demux_video_caps (GstMatroskaTrackVideoContext *
|
|||
/* pixel width and height are the w and h of the video in pixels */
|
||||
if (videocontext->pixel_width > 0 && videocontext->pixel_height > 0) {
|
||||
gint w = videocontext->pixel_width;
|
||||
|
||||
gint h = videocontext->pixel_height;
|
||||
|
||||
gst_structure_set (structure,
|
||||
"width", G_TYPE_INT, w, "height", G_TYPE_INT, h, NULL);
|
||||
}
|
||||
|
||||
if (videocontext->display_width > 0 && videocontext->display_height > 0) {
|
||||
if (videocontext->display_width > 0 || videocontext->display_height > 0) {
|
||||
int n, d;
|
||||
|
||||
if (videocontext->display_width <= 0)
|
||||
videocontext->display_width = videocontext->pixel_width;
|
||||
if (videocontext->display_height <= 0)
|
||||
videocontext->display_height = videocontext->pixel_height;
|
||||
|
||||
/* calculate the pixel aspect ratio using the display and pixel w/h */
|
||||
n = videocontext->display_width * videocontext->pixel_height;
|
||||
d = videocontext->display_height * videocontext->pixel_width;
|
||||
|
|
Loading…
Reference in a new issue