mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-06 22:42:35 +00:00
vorbisdec: Fix check for "-1" bitrate values
The check is exactly the same, but more explicit.
Original commit that introduced the check is
20fb58be19
:
---
vorbisdec: don't put invalid bitrate values into the taglist
Bitrates are stored as 32-bit signed integers in the vorbis
identification headers, but seem to be read incorrectly,
namely as unsigned 32-bit integers, into the vorbis structure
members which are of type long, which makes our check for
values <= 0 fail with files that put -1 in there for unset
values.
---
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/8229>
This commit is contained in:
parent
8b9ac40710
commit
a9984a0003
1 changed files with 3 additions and 3 deletions
|
@ -259,18 +259,18 @@ vorbis_handle_comment_packet (GstVorbisDec * vd, ogg_packet * packet)
|
|||
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
|
||||
GST_TAG_ENCODER_VERSION, vd->vi.version,
|
||||
GST_TAG_AUDIO_CODEC, "Vorbis", NULL);
|
||||
if (vd->vi.bitrate_nominal > 0 && vd->vi.bitrate_nominal <= 0x7FFFFFFF) {
|
||||
if (vd->vi.bitrate_nominal > 0 && vd->vi.bitrate_nominal != (long) -1) {
|
||||
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
|
||||
GST_TAG_NOMINAL_BITRATE, (guint) vd->vi.bitrate_nominal, NULL);
|
||||
bitrate = vd->vi.bitrate_nominal;
|
||||
}
|
||||
if (vd->vi.bitrate_upper > 0 && vd->vi.bitrate_upper <= 0x7FFFFFFF) {
|
||||
if (vd->vi.bitrate_upper > 0 && vd->vi.bitrate_upper != (long) -1) {
|
||||
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
|
||||
GST_TAG_MAXIMUM_BITRATE, (guint) vd->vi.bitrate_upper, NULL);
|
||||
if (!bitrate)
|
||||
bitrate = vd->vi.bitrate_upper;
|
||||
}
|
||||
if (vd->vi.bitrate_lower > 0 && vd->vi.bitrate_lower <= 0x7FFFFFFF) {
|
||||
if (vd->vi.bitrate_lower > 0 && vd->vi.bitrate_lower != (long) -1) {
|
||||
gst_tag_list_add (list, GST_TAG_MERGE_REPLACE,
|
||||
GST_TAG_MINIMUM_BITRATE, (guint) vd->vi.bitrate_lower, NULL);
|
||||
if (!bitrate)
|
||||
|
|
Loading…
Reference in a new issue