[vlc-devel] commit: Retrieve meta from Kate streams, which has Vorbis comment packet ( Vincent Penquerc'h )
git version control
git at videolan.org
Sun Feb 8 16:09:36 CET 2009
vlc | branch: master | Vincent Penquerc'h <ogg.k.ogg.k at googlemail.com> | Sun Feb 8 14:21:16 2009 +0000| [6c95dba474d1f9847e069d2d6cd1af9ecb307ebe] | committer: Rémi Denis-Courmont
Retrieve meta from Kate streams, which has Vorbis comment packet
Do not retrieve from CMML, which has none
Signed-off-by: Rémi Denis-Courmont <rdenis at simphalempin.com>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6c95dba474d1f9847e069d2d6cd1af9ecb307ebe
---
modules/demux/ogg.c | 28 ++++++++++++++++++++++------
1 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/modules/demux/ogg.c b/modules/demux/ogg.c
index 568278f..acc8856 100644
--- a/modules/demux/ogg.c
+++ b/modules/demux/ogg.c
@@ -1491,10 +1491,20 @@ static bool Ogg_LogicalStreamResetEsFormat( demux_t *p_demux, logical_stream_t *
return !b_compatible;
}
-static void Ogg_ExtractXiphMeta( demux_t *p_demux, const uint8_t *p_headers, int i_headers, int i_skip )
+static void Ogg_ExtractXiphMeta( demux_t *p_demux, const uint8_t *p_headers, int i_headers, int i_skip, bool b_has_num_headers )
{
demux_sys_t *p_ogg = p_demux->p_sys;
+ if (b_has_num_headers)
+ {
+ if (i_headers <= 0)
+ return;
+ /* number of headers on a byte, we're interested in the second header, so should be at least 2 to go on */
+ if (*p_headers++ < 2)
+ return;
+ --i_headers;
+ }
+
if( i_headers <= 2 )
return;
@@ -1528,22 +1538,28 @@ static void Ogg_ExtractMeta( demux_t *p_demux, vlc_fourcc_t i_codec, const uint8
{
/* 3 headers with the 2° one being the comments */
case VLC_FOURCC( 'v','o','r','b' ):
- Ogg_ExtractXiphMeta( p_demux, p_headers, i_headers, 1+6 );
+ Ogg_ExtractXiphMeta( p_demux, p_headers, i_headers, 1+6, false );
break;
case VLC_FOURCC( 't','h','e','o' ):
- Ogg_ExtractXiphMeta( p_demux, p_headers, i_headers, 1+6 );
+ Ogg_ExtractXiphMeta( p_demux, p_headers, i_headers, 1+6, false );
break;
case VLC_FOURCC( 's','p','x',' ' ):
- Ogg_ExtractXiphMeta( p_demux, p_headers, i_headers, 0 );
+ Ogg_ExtractXiphMeta( p_demux, p_headers, i_headers, 0, false );
break;
- /* TODO */
+ /* N headers with the 2° one being the comments */
case VLC_FOURCC( 'k','a','t','e' ):
+ /* 1 byte for header type, 7 bit for magic, 1 reserved zero byte */
+ Ogg_ExtractXiphMeta( p_demux, p_headers, i_headers, 1+7+1, true );
+ break;
+
+ /* TODO */
case VLC_FOURCC( 'f','l','a','c' ):
- case VLC_FOURCC( 'c','m','m','l' ):
msg_Warn( p_demux, "Ogg_ExtractMeta does not support %4.4s", (const char*)&i_codec );
break;
+
/* No meta data */
+ case VLC_FOURCC( 'c','m','m','l' ): /* CMML is XML text, doesn't have Vorbis comments */
case VLC_FOURCC( 'd','r','a','c' ):
default:
break;
More information about the vlc-devel
mailing list