View Issue Details

IDProjectCategoryView StatusLast Update
0004542The Dark ModSound Systempublic13.06.2017 17:26
Reporterstgatilov Assigned Tostgatilov  
PrioritynormalSeverityfeatureReproducibilityalways
Status resolvedResolutionfixed 
Target VersionTDM 2.06Fixed in VersionTDM 2.06 
Summary0004542: Support playing stereo sound in cinematics
DescriptionCurrently the cinematics plays sound in the simplest way possible: as mono. If video file contains stereo sound stream, it is anyway converted to mono using swresample library.

We should allow playing at least stereo sound from video file.
In the simplest case we can always convert sound to stereo using swresample (should work without problem even if source is mono). A bit more complicated idea is to look whether the source stream is stereo or beyond, and return stereo data only in this case.
TagsNo tags attached.
Attached Files
CinematicsToMono.patch (916 bytes)   
Index: renderer/CinematicFFMpeg.cpp
===================================================================
--- renderer/CinematicFFMpeg.cpp	(revision 6935)
+++ renderer/CinematicFFMpeg.cpp	(working copy)
@@ -829,7 +829,7 @@
 	_path = qpath;
 	_looping = looping;
 	_withAudio = withAudio;
-	_channels = 2;
+	_channels = 1;
 
 	bool res = false;
 	if (r_cinematic_checkImmediately.GetBool()) {
Index: sound/snd_cache.cpp
===================================================================
--- sound/snd_cache.cpp	(revision 6935)
+++ sound/snd_cache.cpp	(working copy)
@@ -433,7 +433,7 @@
 	cinematic = cin;
 
 	objectInfo.wFormatTag = WAVE_FORMAT_TAG_STREAM_CINEMATICS;
-	objectInfo.nChannels = 2;	//stereo
+	objectInfo.nChannels = 1;	//mono
 	objectInfo.nSamplesPerSec = PRIMARYFREQ;	//44100 hz
 	objectInfo.nAvgBytesPerSec = 0;	//nobody cares
 	objectInfo.nBlockAlign = sizeof(float) * objectInfo.nChannels;
CinematicsToMono.patch (916 bytes)   

Relationships

related to 0004534 resolvedstgatilov Playing sound stream from video file 

Activities

stgatilov

stgatilov

13.06.2017 17:24

administrator   ~0008909

Done in svn rev 6935.
Now cinematics always produces stereo output.
Even if the video file contains mono, swresample library would convert them to stereo =)
stgatilov

stgatilov

13.06.2017 17:26

administrator   ~0008910

In case of any possible trouble with stereo: I have attached a minimal TortoiseSVN patch which switches cinematics back to mono output ("CinematicsToMono.patch").

Issue History

Date Modified Username Field Change
12.06.2017 08:04 stgatilov New Issue
12.06.2017 08:04 stgatilov Status new => assigned
12.06.2017 08:04 stgatilov Assigned To => stgatilov
12.06.2017 08:04 stgatilov Relationship added related to 0004534
13.06.2017 17:24 stgatilov Note Added: 0008909
13.06.2017 17:24 stgatilov File Added: CinematicsToMono.patch
13.06.2017 17:26 stgatilov Note Added: 0008910
13.06.2017 17:26 stgatilov Status assigned => resolved
13.06.2017 17:26 stgatilov Fixed in Version => TDM 2.06
13.06.2017 17:26 stgatilov Resolution open => fixed
13.06.2017 17:26 stgatilov Target Version => TDM 2.06