From: <tp...@ke...> - 2007-03-02 18:10:23
|
CVS Root: /cvs/gstreamer Module: gst-plugins-bad Changes by: tpm Date: Fri Mar 02 2007 18:10:18 UTC Log message: Patch by: Young-Ho Cha <ganadist at chollian net> * ext/dts/gstdtsdec.c: (gst_dtsdec_handle_frame), (gst_dtsdec_change_state): Don't do forced downmixing to stereo, but check what downstream can do and let libdts do the downmixing based on that (#400555). Modified files: . : ChangeLog ext/dts : gstdtsdec.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/ChangeLog.diff?r1=1.2432&r2=1.2433 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gst-plugins-bad/ext/dts/gstdtsdec.c.diff?r1=1.12&r2=1.13 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gst-plugins-bad/ChangeLog,v retrieving revision 1.2432 retrieving revision 1.2433 diff -u -d -r1.2432 -r1.2433 --- ChangeLog 2 Mar 2007 13:33:39 -0000 1.2432 +++ ChangeLog 2 Mar 2007 18:10:06 -0000 1.2433 @@ -1,5 +1,14 @@ 2007-03-02 Tim-Philipp Müller <tim at centricular dot net> + Patch by: Young-Ho Cha <ganadist at chollian net> + + * ext/dts/gstdtsdec.c: (gst_dtsdec_handle_frame), + (gst_dtsdec_change_state): + Don't do forced downmixing to stereo, but check what downstream + can do and let libdts do the downmixing based on that (#400555). +2007-03-02 Tim-Philipp Müller <tim at centricular dot net> Patch by: Lutz Mueller <lutz topfrose de> * ext/neon/gstneonhttpsrc.c: (gst_neonhttp_src_class_init), Index: gstdtsdec.c RCS file: /cvs/gstreamer/gst-plugins-bad/ext/dts/gstdtsdec.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- gstdtsdec.c 29 Oct 2006 19:08:01 -0000 1.12 +++ gstdtsdec.c 2 Mar 2007 18:10:06 -0000 1.13 @@ -392,6 +392,45 @@ gst_dtsdec_update_streaminfo (dts); } + if (dts->request_channels == DTS_CHANNEL) { + GstCaps *caps; + caps = gst_pad_get_allowed_caps (dts->srcpad); + if (caps && gst_caps_get_size (caps) > 0) { + GstCaps *copy = gst_caps_copy_nth (caps, 0); + GstStructure *structure = gst_caps_get_structure (copy, 0); + gint channels; + const int dts_channels[6] = { + DTS_MONO, + DTS_STEREO, + DTS_STEREO | DTS_LFE, + DTS_2F2R, + DTS_2F2R | DTS_LFE, + DTS_3F2R | DTS_LFE, + }; + /* Prefer the original number of channels, but fixate to something + * preferred (first in the caps) downstream if possible. + */ + gst_structure_fixate_field_nearest_int (structure, "channels", + flags ? gst_dtsdec_channels (flags, NULL) : 6); + gst_structure_get_int (structure, "channels", &channels); + if (channels <= 6) + dts->request_channels = dts_channels[channels - 1]; + else + dts->request_channels = dts_channels[5]; + gst_caps_unref (copy); + } else if (flags) { + dts->request_channels = dts->stream_channels; + } else { + dts->request_channels = DTS_3F2R | DTS_LFE; + } + if (caps) + gst_caps_unref (caps); + } /* process */ flags = dts->request_channels | DTS_ADJUST_LEVEL; dts->level = 1; @@ -539,7 +578,7 @@ dts->sample_rate = -1; dts->stream_channels = 0; /* FIXME force stereo for now */ - dts->request_channels = DTS_STEREO; + dts->request_channels = DTS_CHANNEL; dts->using_channels = 0; dts->level = 1; dts->bias = 0; |