Skip to content

Commit

Permalink
+ FLAC: difference between real Bit depth (quantization) and stored b…
Browse files Browse the repository at this point in the history
…it depth
  • Loading branch information
JeromeMartinez committed Nov 11, 2015
1 parent 1d3b429 commit b117425
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions History_DLL.txt
Expand Up @@ -12,6 +12,7 @@ Version 0.7.80
--------------
+ Matroska: support of MKVMerge statistics tags (duration frame count, stream size, bit rate) per track, thanks to ndjamena
+ FLAC: Channel positions, thanks to ndjamena
+ FLAC: difference between real Bit depth (quantization) and stored bit depth

Version 0.7.79, 2015-11-02
--------------
Expand Down
10 changes: 10 additions & 0 deletions Source/MediaInfo/Audio/File_Flac.cpp
Expand Up @@ -227,6 +227,16 @@ void File_Flac::VORBIS_COMMENT()
Open_Buffer_Init(&VorbisCom);
Open_Buffer_Continue(&VorbisCom);
File__Analyze::Finish(&VorbisCom);

//Specific case: bit depth
if (!VorbisCom.Retrieve(Stream_Audio, 0, Audio_BitDepth).empty() && VorbisCom.Retrieve(Stream_Audio, 0, Audio_BitDepth).To_int64u()<Retrieve(Stream_Audio, 0, Audio_BitDepth).To_int64u())
{
//Bit depth information from tags is the real value, the one from Flac is the count of bits stored
Fill(Stream_Audio, 0, Audio_BitDepth_Stored, Retrieve(Stream_Audio, 0, Audio_BitDepth));
Fill(Stream_Audio, 0, Audio_BitDepth, VorbisCom.Retrieve(Stream_Audio, 0, Audio_BitDepth), true);
VorbisCom.Clear(Stream_Audio, 0, Audio_BitDepth);
}

Merge(VorbisCom, Stream_General, 0, 0);
Merge(VorbisCom, Stream_Audio, 0, 0);
Merge(VorbisCom, Stream_Menu, 0, 0);
Expand Down
2 changes: 1 addition & 1 deletion Source/MediaInfo/Tag/File_VorbisCom.cpp
Expand Up @@ -294,7 +294,7 @@ void File_VorbisCom::Data_Parse()
Fill(Stream_Audio, 0, Audio_ChannelPositions_String2, ExtensibleWave_ChannelMask2(ValueI));
}
}
else if (Key==__T("VALID_BITS")) { Fill(Stream_Audio, 0, "Valid bits", Value); }
else if (Key==__T("VALID_BITS")) { if (Value.To_int64u()) Fill(Stream_Audio, 0, Audio_BitDepth, Value); }
else if (Key==__T("HDCD")) { if (Value != __T("0")) { Fill(Stream_Audio, 0, "HDCD", "Yes"); } }
else if (Key==__T("YEAR")) {if (Value!=Retrieve(StreamKind_Common, 0, "Recorded_Date")) Fill(StreamKind_Common, 0, "Recorded_Date", Value);}
else if (Key.find(__T("COVERART"))==0)
Expand Down

0 comments on commit b117425

Please sign in to comment.