]> granicus.if.org Git - handbrake/commitdiff
Improve last commit. While the AC3 decoder doesn't use hb_ff_layout_xlat(), the code...
authorRodeo <tdskywalker@gmail.com>
Sat, 11 Aug 2012 18:30:28 +0000 (18:30 +0000)
committerRodeo <tdskywalker@gmail.com>
Sat, 11 Aug 2012 18:30:28 +0000 (18:30 +0000)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4899 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/audio_resample.c
libhb/hb.c

index 45d2fdf42e723721108d3c82dce0477082a579dc..94ab3b531986b9236849f6b82933f787a7259ede 100644 (file)
@@ -53,6 +53,11 @@ int hb_audio_resample_update(hb_audio_resample_t *resample,
     int ret, resample_changed;
 
     new_channel_layout = hb_ff_layout_xlat(new_channel_layout, new_channels);
+    if (new_channel_layout == AV_CH_LAYOUT_STEREO_DOWNMIX)
+    {
+        // Dolby Surround is Stereo when it comes to remixing
+        new_channel_layout = AV_CH_LAYOUT_STEREO;
+    }
 
     resample->resample_needed =
         (resample->resample_needed ||
index c51683c7c594f8b1843ec306755754c2458a2e06..cc9fd227922f2e99b6364f6364f7003499e5715a 100644 (file)
@@ -266,11 +266,6 @@ uint64_t hb_ff_layout_xlat(uint64_t ff_channel_layout, int nchannels)
                      ff_channel_layout, nchannels);
         }
     }
-    else if (hb_layout == AV_CH_LAYOUT_STEREO_DOWNMIX)
-    {
-        // Dolby is really only Stereo as far as downmixing is concerned
-        hb_layout = AV_CH_LAYOUT_STEREO;
-    }
     return hb_layout;
 }