From 6fd97529b5c7a29a46ab6c7e025ab436bb8ba51b Mon Sep 17 00:00:00 2001 From: wuggy Date: Tue, 8 Sep 2026 11:25:45 -0700 Subject: [PATCH] Actually enable DirectShow :meef: --- dom/media/directshow/DirectShowReader.cpp | 8 ++++---- moz.configure | 10 ++++++++++ 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/dom/media/directshow/DirectShowReader.cpp b/dom/media/directshow/DirectShowReader.cpp index 9bfecbec57..54364405c2 100644 --- a/dom/media/directshow/DirectShowReader.cpp +++ b/dom/media/directshow/DirectShowReader.cpp @@ -98,10 +98,7 @@ DirectShowReader::ReadMetadata(MediaInfo* aInfo, reinterpret_cast(static_cast(getter_AddRefs(mGraph)))); NS_ENSURE_TRUE(SUCCEEDED(hr) && mGraph, NS_ERROR_FAILURE); - rv = ParseMP3Headers(&mMP3FrameParser, mDecoder->GetResource()); - NS_ENSURE_SUCCESS(rv, rv); - - #ifdef DIRECTSHOW_REGISTER_GRAPH +#ifdef DIRECTSHOW_REGISTER_GRAPH hr = AddGraphToRunningObjectTable(mGraph, &mRotRegister); NS_ENSURE_TRUE(SUCCEEDED(hr), NS_ERROR_FAILURE); #endif @@ -117,6 +114,9 @@ DirectShowReader::ReadMetadata(MediaInfo* aInfo, return ReadH264Metadata(aInfo, aTags); } + rv = ParseMP3Headers(&mMP3FrameParser, mDecoder->GetResource()); + NS_ENSURE_SUCCESS(rv, rv); + // Build the graph. Create the filters we need, and connect them. We // build the entire graph ourselves to prevent other decoders installed // on the system being created and used. diff --git a/moz.configure b/moz.configure index f4cbbed1c8..ec5b027219 100644 --- a/moz.configure +++ b/moz.configure @@ -5,6 +5,16 @@ include('build/moz.configure/init.configure') +# DirectShow is the legacy Windows media backend. Keep this independent of +# the old configure scripts so the backend is actually compiled on Windows. +@depends(target) +def directshow_enabled(target): + if target.kernel == 'WINNT': + return True + +set_config('MOZ_DIRECTSHOW', directshow_enabled) +set_define('MOZ_DIRECTSHOW', directshow_enabled) + # Note: # - Gecko-specific options and rules should go in toolkit/moz.configure. # - Firefox-specific options and rules should go in browser/moz.configure.