diff options
author | Michael Stahl <michael.stahl@allotropia.de> | 2023-04-05 11:50:44 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2023-04-05 14:34:51 +0200 |
commit | a5225ba82e94a549f44420f56a7cb9d7906561cc (patch) | |
tree | 084be80b91028e3bfbe8cd5e3b50ba97fa8b516d /oox | |
parent | 8b4af1eb0549b6832361da85ddaa1e13be34ec76 (diff) |
avmedia,*: guess the mime type of media files based on file name
.. at least for the most popular types, and do it automatically in
MediaItem::setURL().
This should work in practice in most cases and is much simpler than
adding some type detection or calling into platform dependent avmedia
backends.
Remove the parameter that was only ever set to
"application/vnd.sun.star.media" anyway, the same value that would be
used if it's missing.
Stop using that silly type for everything, only use it when guessing
fails.
In case an ODF document is loaded, it will use the mime type loaded from
the file (see setting of MediaMimeType in SdXMLPluginShapeContext) and
not guess it because that would require updating the entry in
manifest.xml as well.
Change-Id: I8ce29cf7425678ae11dda1d8c875be818f8623af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150049
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'oox')
-rw-r--r-- | oox/source/export/drawingml.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index d610435d0eb2..59d67393bed5 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -1425,6 +1425,11 @@ void DrawingML::WriteMediaNonVisualProperties(const css::uno::Reference<css::dra #else OUString aMimeType("none"); #endif + if (aMimeType.startsWith("audio/")) + { + eMediaType = Relationship::AUDIO; + } + else if (aMimeType == "application/vnd.sun.star.media") { // try to set something better |