From b7cf10eb6db8be76ea4f3b1d44f68d0a699ec4ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Fri, 2 Feb 2007 11:21:48 +0000 Subject: [PATCH] gst/audioconvert/gstaudioconvert.c: We don't support floats with a width of 40, 48 or 56 bits. Original commit message from CVS: * gst/audioconvert/gstaudioconvert.c: (set_structure_widths_32_and_64), (make_lossless_changes): We don't support floats with a width of 40, 48 or 56 bits. --- ChangeLog | 6 ++++++ gst/audioconvert/gstaudioconvert.c | 20 +++++++++++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e17a157ff5..ba61153d7e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-02-02 Tim-Philipp Müller + + * gst/audioconvert/gstaudioconvert.c: + (set_structure_widths_32_and_64), (make_lossless_changes): + We don't support floats with a width of 40, 48 or 56 bits. + 2007-02-02 Stefan Kost * gst/audioconvert/audioconvert.c: (float), (double), diff --git a/gst/audioconvert/gstaudioconvert.c b/gst/audioconvert/gstaudioconvert.c index 265abe06ff..f8447733c6 100644 --- a/gst/audioconvert/gstaudioconvert.c +++ b/gst/audioconvert/gstaudioconvert.c @@ -345,6 +345,24 @@ set_structure_widths (GstStructure * s, int min, int max) g_value_unset (&list); } +/* Set widths of 32 bits and 64 bits (as list) */ +static void +set_structure_widths_32_and_64 (GstStructure * s) +{ + GValue list = { 0 }; + GValue val = { 0 }; + + g_value_init (&list, GST_TYPE_LIST); + g_value_init (&val, G_TYPE_INT); + g_value_set_int (&val, 32); + gst_value_list_append_value (&list, &val); + g_value_set_int (&val, 64); + gst_value_list_append_value (&list, &val); + gst_structure_set_value (s, "width", &list); + g_value_unset (&val); + g_value_unset (&list); +} + /* Modify the structure so that things that must always have a single * value (for float), or can always be losslessly converted (for int), have * appropriate values. @@ -357,7 +375,7 @@ make_lossless_changes (GstStructure * s, gboolean isfloat) * widths of 32/64 and native endianness */ gst_structure_remove_field (s, "depth"); gst_structure_remove_field (s, "signed"); - set_structure_widths (s, 32, 64); + set_structure_widths_32_and_64 (s); gst_structure_set (s, "endianness", G_TYPE_INT, G_BYTE_ORDER, NULL); } else { /* int supports either endian, and signed or unsigned. GValues are a pain */