summaryrefslogtreecommitdiffstats
path: root/ext
diff options
context:
space:
mode:
authorJan Schmidt <thaytan@mad.scientist.com>2005-12-09 15:30:21 +0000
committerJan Schmidt <thaytan@mad.scientist.com>2005-12-09 15:30:21 +0000
commit1501b485b1a64e5d5f84de3c72540013706f85ce (patch)
tree2b1485c456b2af5818ccbddd9f829262763bb456 /ext
parentb57b82d528198c35d721aad073d1048bb5b961e2 (diff)
downloadgst-plugins-bad-1501b485b1a64e5d5f84de3c72540013706f85ce.tar.gz
gst-plugins-bad-1501b485b1a64e5d5f84de3c72540013706f85ce.tar.bz2
gst-plugins-bad-1501b485b1a64e5d5f84de3c72540013706f85ce.zip
ext/faad/gstfaad.c: Assume that an unknown channel mapping with 2 channels is stereo and play it that way instead of ...
Original commit message from CVS: * ext/faad/gstfaad.c: (gst_faad_chanpos_to_gst), (gst_faad_update_caps): Assume that an unknown channel mapping with 2 channels is stereo and play it that way instead of erroring. * gst/qtdemux/qtdemux.c: (gst_qtdemux_loop_header), (gst_qtdemux_add_stream), (qtdemux_parse_trak): Handle e.g. jpeg streams with 0 duration frames as having 0 framerate. Debug fixes. Some 64 bit variable fixes
Diffstat (limited to 'ext')
-rw-r--r--ext/faad/gstfaad.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/ext/faad/gstfaad.c b/ext/faad/gstfaad.c
index 299e7d19..2de3ebb5 100644
--- a/ext/faad/gstfaad.c
+++ b/ext/faad/gstfaad.c
@@ -315,6 +315,7 @@ gst_faad_chanpos_to_gst (guchar * fpos, guint num)
{
GstAudioChannelPosition *pos = g_new (GstAudioChannelPosition, num);
guint n;
+ gboolean unknown_channel = FALSE;
for (n = 0; n < num; n++) {
switch (fpos[n]) {
@@ -350,10 +351,20 @@ gst_faad_chanpos_to_gst (guchar * fpos, guint num)
pos[n] = GST_AUDIO_CHANNEL_POSITION_LFE;
break;
default:
- GST_WARNING ("Unsupported FAAD channel position 0x%x encountered",
- fpos[n]);
- g_free (pos);
- return NULL;
+ unknown_channel = TRUE;
+ break;
+ }
+ }
+ if (unknown_channel) {
+ if (num == 2) {
+ GST_DEBUG ("FAAD reports unknown 2 channel mapping. Forcing to stereo");
+ pos[0] = GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT;
+ pos[1] = GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT;
+ } else {
+ GST_WARNING ("Unsupported FAAD channel position 0x%x encountered",
+ fpos[n]);
+ g_free (pos);
+ return NULL;
}
}
@@ -729,6 +740,11 @@ gst_faad_update_caps (GstFaad * faad, faacDecFrameInfo * info,
faad->bps = 16 / 8;
pos = gst_faad_chanpos_to_gst (faad->channel_positions, faad->channels);
+ if (!pos) {
+ GST_DEBUG_OBJECT (faad, "Could not map channel positions");
+ gst_caps_unref (caps);
+ return FALSE;
+ }
gst_audio_set_channel_positions (gst_caps_get_structure (caps, 0), pos);
g_free (pos);