From 81b2bf43c688e081454b6382db8c7cd917232446 Mon Sep 17 00:00:00 2001 From: Nicolas Chauvet Date: Thu, 12 Oct 2023 16:42:21 +0200 Subject: [PATCH] Revert "taglib: wav: fix RIFF INFO tags parsing" This reverts commit 85868dfb0319dced501a78dfd2ee6432d6be90f3. --- modules/meta_engine/taglib.cpp | 38 ++++++---------------------------- 1 file changed, 6 insertions(+), 32 deletions(-) diff --git a/modules/meta_engine/taglib.cpp b/modules/meta_engine/taglib.cpp index 84b401c795a9..d65607b98dc0 100644 --- a/modules/meta_engine/taglib.cpp +++ b/modules/meta_engine/taglib.cpp @@ -845,28 +845,6 @@ static void ReadMetaFromMP4( MP4::Tag* tag, demux_meta_t *p_demux_meta, vlc_meta } } -static int ReadWAVMeta( const RIFF::WAV::File *wav, demux_meta_t *demux_meta ) -{ - if( !wav->hasID3v2Tag() && !wav->hasInfoTag() ) - return VLC_EGENERIC; - - demux_meta->p_meta = vlc_meta_New(); - if( !demux_meta->p_meta ) - return VLC_ENOMEM; - - TAB_INIT( demux_meta->i_attachments, demux_meta->attachments ); - - if( wav->hasInfoTag() ) - ReadMetaFromBasicTag( wav->InfoTag(), demux_meta->p_meta ); - if( wav->hasID3v2Tag() ) - { - // Re-read basic tags from id3 to prioritize it against INFO tags. - ReadMetaFromBasicTag( wav->ID3v2Tag(), demux_meta->p_meta ); - ReadMetaFromId3v2( wav->ID3v2Tag(), demux_meta, demux_meta->p_meta ); - } - return VLC_SUCCESS; -} - /** * Get the tags from the file using TagLib * @param p_this: the demux object @@ -942,14 +920,6 @@ static int ReadMeta( vlc_object_t* p_this) if( f.isNull() ) return VLC_EGENERIC; - - // XXX: Workaround a quirk in TagLib that doesn't merge id3 tags and RIFF - // INFO tags in `Wav::File::tag()`'s return value. - // This forces us to parse WAV separately for now. - const auto* riff_wav = dynamic_cast(f.file()); - if (riff_wav != nullptr) - return ReadWAVMeta(riff_wav, p_demux_meta); - if( !f.tag() || f.tag()->isEmpty() ) return VLC_EGENERIC; @@ -957,6 +927,7 @@ static int ReadMeta( vlc_object_t* p_this) if( !p_meta ) return VLC_ENOMEM; + // Read the tags from the file ReadMetaFromBasicTag(f.tag(), p_meta); @@ -1011,9 +982,12 @@ static int ReadMeta( vlc_object_t* p_this) ReadMetaFromXiph( ogg_opus->tag(), p_demux_meta, p_meta ); #endif } - else if( RIFF::AIFF::File* riff_aiff = dynamic_cast(f.file()) ) + else if( dynamic_cast(f.file()) ) { - ReadMetaFromId3v2( riff_aiff->tag(), p_demux_meta, p_meta ); + if( RIFF::AIFF::File* riff_aiff = dynamic_cast(f.file()) ) + ReadMetaFromId3v2( riff_aiff->tag(), p_demux_meta, p_meta ); + else if( RIFF::WAV::File* riff_wav = dynamic_cast(f.file()) ) + ReadMetaFromId3v2( riff_wav->tag(), p_demux_meta, p_meta ); } else if( TrueAudio::File* trueaudio = dynamic_cast(f.file()) ) { -- 2.41.0