GNOME Bugzilla – Bug 749109
codec-utils: add a gst_codec_utils_aac_get_sample_rate
Last modified: 2016-03-24 13:04:47 UTC
To remove the FIXME in the qtdemux, I add this function.
Created attachment 303078 [details] [review] codec-utils: add a gst_codec_utils_aac_get_sample_rate
Comment on attachment 303078 [details] [review] codec-utils: add a gst_codec_utils_aac_get_sample_rate I'm not sure yet if we really need this new function, but some review comments nevertheless: >+ * Returns the sample rate of the given AAC stream. >+ * >+ * Returns: The sample rate if rate_index is valid, 0 otherwise. >+ */ Copy'n'paste from the index-based function. Should also have a Since: 1.6 marker at the end. >+guint >+gst_codec_utils_aac_get_sample_rate (const guint8 * audio_config) Should take a size/length argument like the other functions (and check it). >+ rate = gst_codec_utils_aac_get_sample_rate_from_index (rate_index); >+ if (rate > 0) >+ return rate; >+ else >+ return 0; >+} Might just as well just write return gst_codec_utils_aac_get_sample_rate_from_index (..) then :)
(In reply to Tim-Philipp Müller from comment #2) > Comment on attachment 303078 [details] [review] [review] > codec-utils: add a gst_codec_utils_aac_get_sample_rate > > I'm not sure yet if we really need this new function, but some review > comments nevertheless: > > > >+ * Returns the sample rate of the given AAC stream. > >+ * > >+ * Returns: The sample rate if rate_index is valid, 0 otherwise. > >+ */ > > Copy'n'paste from the index-based function. Should also have a Since: 1.6 > marker at the end. > > > >+guint > >+gst_codec_utils_aac_get_sample_rate (const guint8 * audio_config) > > Should take a size/length argument like the other functions (and check it). > > >+ rate = gst_codec_utils_aac_get_sample_rate_from_index (rate_index); > >+ if (rate > 0) > >+ return rate; > >+ else > >+ return 0; > >+} > > Might just as well just write > > return gst_codec_utils_aac_get_sample_rate_from_index (..) > > then :) It's kind of you to help me. It's clear:)
Created attachment 304100 [details] [review] codec-utils: add a gst_codec_utils_aac_get_sample_rate
:( I forgot the since 1.6 marker I'll update new patch
Created attachment 304165 [details] [review] codec-utils: add a gst_codec_utils_aac_get_sample_rate
Review of attachment 304165 [details] [review]: Please merge this with the patch that gets the channel count. ::: gst-libs/gst/pbutils/codec-utils.c @@ +118,3 @@ + * Returns: The sample rate if sr_idx is valid, 0 otherwise. + * + * Since 1.6 We're at 1.10 now
I've merge patches at below link. https://bugzilla.gnome.org/show_bug.cgi?id=749110