diff --git a/ChangeLog b/ChangeLog index 805e2fc5a2..180bfd4078 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-08-28 Wim Taymans + + Patch by: Mersad Jelacic + + * gst/multipart/multipartdemux.c: + * gst/multipart/multipartmux.c: (gst_multipart_mux_get_mime): + Convert audio/x-adpcm to and from the audio/G726-X in the muxer and + demuxer. Fixes #549551. + 2008-08-27 Edward Hervey * sys/osxaudio/gstosxaudiosink.c: diff --git a/gst/multipart/multipartdemux.c b/gst/multipart/multipartdemux.c index 200f36ad2a..eeffd4e1d6 100644 --- a/gst/multipart/multipartdemux.c +++ b/gst/multipart/multipartdemux.c @@ -110,6 +110,10 @@ typedef struct static const GstNamesMap gstnames[] = { /* RFC 2046 says audio/basic is mulaw, mono, 8000Hz */ {"audio/basic", "audio/x-mulaw, channels=1, rate=8000"}, + {"audio/G726-16", "audio/x-adpcm, bitrate=16000"}, + {"audio/G726-24", "audio/x-adpcm, bitrate=24000"}, + {"audio/G726-32", "audio/x-adpcm, bitrate=32000"}, + {"audio/G726-40", "audio/x-adpcm, bitrate=40000"}, {NULL, NULL} }; diff --git a/gst/multipart/multipartmux.c b/gst/multipart/multipartmux.c index a4a1300fe0..45bc4bd7e0 100644 --- a/gst/multipart/multipartmux.c +++ b/gst/multipart/multipartmux.c @@ -293,6 +293,7 @@ gst_multipart_mux_get_mime (GstMultipartMux * mux, GstStructure * s) const gchar *name; gint rate; gint channels; + gint bitrate = 0; klass = GST_MULTIPART_MUX_GET_CLASS (mux); @@ -301,8 +302,27 @@ gst_multipart_mux_get_mime (GstMultipartMux * mux, GstStructure * s) /* use hashtable to convert to mime type */ mime = g_hash_table_lookup (klass->mimetypes, name); if (mime == NULL) { - /* no mime type mapping, use name */ - mime = name; + if (!strcmp (name, "audio/x-adpcm")) + gst_structure_get_int (s, "bitrate", &bitrate); + + switch (bitrate) { + case 16000: + mime = "audio/G726-16"; + break; + case 24000: + mime = "audio/G726-24"; + break; + case 32000: + mime = "audio/G726-32"; + break; + case 40000: + mime = "audio/G726-40"; + break; + default: + /* no mime type mapping, use name */ + mime = name; + break; + } } /* RFC2046 requires audio/basic to be mulaw 8000Hz mono */ if (g_ascii_strcasecmp (mime, "audio/basic") == 0) {