mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-22 23:28:16 +00:00
avidemux: Always set pixel-aspect-ratio on raw video streams
That field is mandatory in caps and if it is not present in the AVI container, it means square pixels thus 1/1.
This commit is contained in:
parent
821c68822b
commit
511202d50c
1 changed files with 11 additions and 5 deletions
|
@ -1944,11 +1944,17 @@ gst_avi_demux_check_caps (GstAviDemux * avi, GstCaps * caps,
|
|||
caps = gst_caps_make_writable (caps);
|
||||
|
||||
s = gst_caps_get_structure (caps, 0);
|
||||
if (gst_structure_has_name (s, "video/x-raw") &&
|
||||
gst_structure_has_field_typed (s, "palette_data", GST_TYPE_BUFFER)) {
|
||||
gst_structure_get (s, "palette_data", GST_TYPE_BUFFER, rgb8_palette, NULL);
|
||||
gst_structure_remove_field (s, "palette_data");
|
||||
return caps;
|
||||
if (gst_structure_has_name (s, "video/x-raw")) {
|
||||
stream->is_raw = TRUE;
|
||||
if (!gst_structure_has_field (s, "pixel-aspect-ratio"))
|
||||
gst_structure_set (s, "pixel-aspect-ratio", GST_TYPE_FRACTION,
|
||||
1, 1, NULL);
|
||||
if (gst_structure_has_field_typed (s, "palette_data", GST_TYPE_BUFFER)) {
|
||||
gst_structure_get (s, "palette_data", GST_TYPE_BUFFER,
|
||||
&stream->rgb8_palette, NULL);
|
||||
gst_structure_remove_field (s, "palette_data");
|
||||
return caps;
|
||||
}
|
||||
} else if (!gst_structure_has_name (s, "video/x-h264")) {
|
||||
return caps;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue