Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
fa84b4cf
Commit
fa84b4cf
authored
Dec 06, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not access input object from decoders.
parent
30815340
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
80 deletions
+35
-80
modules/codec/faad.c
modules/codec/faad.c
+6
-14
modules/codec/kate.c
modules/codec/kate.c
+6
-6
modules/codec/speex.c
modules/codec/speex.c
+11
-20
modules/codec/theora.c
modules/codec/theora.c
+6
-6
modules/codec/vorbis.c
modules/codec/vorbis.c
+6
-34
No files found.
modules/codec/faad.c
View file @
fa84b4cf
...
...
@@ -365,27 +365,19 @@ static aout_buffer_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
=
pi_channels_guessed
[
frame
.
channels
];
/* Adjust stream info when dealing with SBR/PS */
if
(
(
p_sys
->
b_sbr
!=
frame
.
sbr
||
p_sys
->
b_ps
!=
frame
.
ps
)
&&
p_dec
->
p_parent
->
i_object_type
==
VLC_OBJECT_INPUT
)
if
(
p_sys
->
b_sbr
!=
frame
.
sbr
||
p_sys
->
b_ps
!=
frame
.
ps
)
{
input_thread_t
*
p_input
=
(
input_thread_t
*
)
p_dec
->
p_parent
;
char
*
psz_cat
;
const
char
*
psz_ext
=
(
frame
.
sbr
&&
frame
.
ps
)
?
"SBR+PS"
:
frame
.
sbr
?
"SBR"
:
"PS"
;
msg_Dbg
(
p_dec
,
"AAC %s (channels: %u, samplerate: %lu)"
,
psz_ext
,
frame
.
channels
,
frame
.
samplerate
);
if
(
asprintf
(
&
psz_cat
,
_
(
"Stream %d"
),
p_dec
->
fmt_in
.
i_id
)
!=
-
1
)
{
input_Control
(
p_input
,
INPUT_ADD_INFO
,
psz_cat
,
_
(
"AAC extension"
),
"%s"
,
psz_ext
);
input_Control
(
p_input
,
INPUT_ADD_INFO
,
psz_cat
,
_
(
"Channels"
),
"%d"
,
frame
.
channels
);
input_Control
(
p_input
,
INPUT_ADD_INFO
,
psz_cat
,
_
(
"Sample rate"
),
_
(
"%d Hz"
),
frame
.
samplerate
);
free
(
psz_cat
);
}
if
(
!
p_dec
->
p_description
)
p_dec
->
p_description
=
vlc_meta_New
();
if
(
p_dec
->
p_description
)
vlc_meta_AddExtra
(
p_dec
->
p_description
,
_
(
"AAC extension"
),
psz_ext
);
p_sys
->
b_sbr
=
frame
.
sbr
;
p_sys
->
b_ps
=
frame
.
ps
;
}
...
...
modules/codec/kate.c
View file @
fa84b4cf
...
...
@@ -702,16 +702,13 @@ static subpicture_t *DecodePacket( decoder_t *p_dec, kate_packet *p_kp, block_t
}
/*****************************************************************************
* ParseKateComments:
FIXME should be done in demuxer
* ParseKateComments:
*****************************************************************************/
static
void
ParseKateComments
(
decoder_t
*
p_dec
)
{
input_thread_t
*
p_input
=
(
input_thread_t
*
)
p_dec
->
p_parent
;
char
*
psz_name
,
*
psz_value
,
*
psz_comment
;
int
i
=
0
;
if
(
p_input
->
i_object_type
!=
VLC_OBJECT_INPUT
)
return
;
while
(
i
<
p_dec
->
p_sys
->
kc
.
comments
)
{
psz_comment
=
strdup
(
p_dec
->
p_sys
->
kc
.
user_comments
[
i
]
);
...
...
@@ -723,8 +720,11 @@ static void ParseKateComments( decoder_t *p_dec )
{
*
psz_value
=
'\0'
;
psz_value
++
;
input_Control
(
p_input
,
INPUT_ADD_INFO
,
_
(
"Kate comment"
),
psz_name
,
"%s"
,
psz_value
);
if
(
!
p_dec
->
p_description
)
p_dec
->
p_description
=
vlc_meta_New
();
if
(
p_dec
->
p_description
)
vlc_meta_AddExtra
(
p_dec
->
p_description
,
psz_name
,
psz_value
);
}
free
(
psz_comment
);
i
++
;
...
...
modules/codec/speex.c
View file @
fa84b4cf
...
...
@@ -812,7 +812,7 @@ static block_t *SendPacket( decoder_t *p_dec, block_t *p_block )
}
/*****************************************************************************
* ParseSpeexComments:
FIXME should be done in demuxer
* ParseSpeexComments:
*****************************************************************************/
#define readint(buf, base) (((buf[base+3]<<24)&0xff000000)| \
((buf[base+2]<<16)&0xff0000)| \
...
...
@@ -821,40 +821,31 @@ static block_t *SendPacket( decoder_t *p_dec, block_t *p_block )
static
void
ParseSpeexComments
(
decoder_t
*
p_dec
,
ogg_packet
*
p_oggpacket
)
{
input_thread_t
*
p_input
=
(
input_thread_t
*
)
p_dec
->
p_parent
;
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
char
*
p_buf
=
(
char
*
)
p_oggpacket
->
packet
;
const
SpeexMode
*
p_mode
;
int
i_len
;
if
(
p_input
->
i_object_type
!=
VLC_OBJECT_INPUT
)
return
;
assert
(
p_sys
->
p_header
->
mode
<
SPEEX_NB_MODES
);
p_mode
=
speex_mode_list
[
p_sys
->
p_header
->
mode
];
assert
(
p_mode
!=
NULL
);
input_Control
(
p_input
,
INPUT_ADD_INFO
,
_
(
"Speex comment"
),
_
(
"Mode"
),
"%s%s"
,
p_mode
->
modeName
,
p_sys
->
p_header
->
vbr
?
" VBR"
:
""
);
if
(
p_oggpacket
->
bytes
<
8
)
if
(
!
p_dec
->
p_description
)
{
msg_Err
(
p_dec
,
"invalid/corrupted comments"
);
return
;
p_dec
->
p_description
=
vlc_meta_New
();
if
(
!
p_dec
->
p_description
)
return
;
}
i_len
=
readint
(
p_buf
,
0
);
p_buf
+=
4
;
if
(
i_len
>
p_oggpacket
->
bytes
-
4
)
/* */
char
*
psz_mode
;
if
(
asprintf
(
&
psz_mode
,
"%s%s"
,
p_mode
->
modeName
,
p_sys
->
p_header
->
vbr
?
" VBR"
:
""
)
>=
0
)
{
msg_Err
(
p_dec
,
"invalid/corrupted comments"
);
return
;
vlc_meta_AddExtra
(
p_dec
->
p_description
,
_
(
"Mode"
),
psz_mode
);
free
(
psz_mode
)
;
}
input_Control
(
p_input
,
INPUT_ADD_INFO
,
_
(
"Speex comment"
),
p_buf
,
""
);
/* TODO: finish comments parsing */
VLC_UNUSED
(
p_oggpacket
);
}
/*****************************************************************************
...
...
modules/codec/theora.c
View file @
fa84b4cf
...
...
@@ -506,16 +506,13 @@ static picture_t *DecodePacket( decoder_t *p_dec, ogg_packet *p_oggpacket )
}
/*****************************************************************************
* ParseTheoraComments:
FIXME should be done in demuxer
* ParseTheoraComments:
*****************************************************************************/
static
void
ParseTheoraComments
(
decoder_t
*
p_dec
)
{
input_thread_t
*
p_input
=
(
input_thread_t
*
)
p_dec
->
p_parent
;
char
*
psz_name
,
*
psz_value
,
*
psz_comment
;
int
i
=
0
;
if
(
p_input
->
i_object_type
!=
VLC_OBJECT_INPUT
)
return
;
while
(
i
<
p_dec
->
p_sys
->
tc
.
comments
)
{
psz_comment
=
strdup
(
p_dec
->
p_sys
->
tc
.
user_comments
[
i
]
);
...
...
@@ -527,8 +524,11 @@ static void ParseTheoraComments( decoder_t *p_dec )
{
*
psz_value
=
'\0'
;
psz_value
++
;
input_Control
(
p_input
,
INPUT_ADD_INFO
,
_
(
"Theora comment"
),
psz_name
,
"%s"
,
psz_value
);
if
(
!
p_dec
->
p_description
)
p_dec
->
p_description
=
vlc_meta_New
();
if
(
p_dec
->
p_description
)
vlc_meta_AddExtra
(
p_dec
->
p_description
,
psz_name
,
psz_value
);
}
free
(
psz_comment
);
i
++
;
...
...
modules/codec/vorbis.c
View file @
fa84b4cf
...
...
@@ -605,16 +605,9 @@ static block_t *SendPacket( decoder_t *p_dec, ogg_packet *p_oggpacket,
*****************************************************************************/
static
void
ParseVorbisComments
(
decoder_t
*
p_dec
)
{
input_thread_t
*
p_input
=
(
input_thread_t
*
)
p_dec
->
p_parent
;
char
*
psz_name
,
*
psz_value
,
*
psz_comment
;
input_item_t
*
p_item
;
int
i
=
0
;
if
(
p_input
->
i_object_type
!=
VLC_OBJECT_INPUT
)
return
;
p_item
=
input_GetItem
(
p_input
);
while
(
i
<
p_dec
->
p_sys
->
vc
.
comments
)
{
psz_comment
=
strdup
(
p_dec
->
p_sys
->
vc
.
user_comments
[
i
]
);
...
...
@@ -626,33 +619,12 @@ static void ParseVorbisComments( decoder_t *p_dec )
{
*
psz_value
=
'\0'
;
psz_value
++
;
input_Control
(
p_input
,
INPUT_ADD_INFO
,
_
(
"Vorbis comment"
),
psz_name
,
"%s"
,
psz_value
);
/*TODO: dot he test at the beginning and save time !! */
#ifndef HAVE_TAGLIB
if
(
psz_value
&&
(
*
psz_value
!=
'\0'
)
)
{
if
(
!
strcasecmp
(
psz_name
,
"artist"
)
)
input_item_SetArtist
(
p_item
,
psz_value
);
else
if
(
!
strcasecmp
(
psz_name
,
"title"
)
)
{
input_item_SetTitle
(
p_item
,
psz_value
);
p_item
->
psz_name
=
strdup
(
psz_value
);
}
else
if
(
!
strcasecmp
(
psz_name
,
"album"
)
)
{
input_item_SetAlbum
(
p_item
,
psz_value
);
}
else
if
(
!
strcasecmp
(
psz_name
,
"musicbrainz_trackid"
)
)
input_item_SetTrackID
(
p_item
,
psz_value
);
#if 0 //not used
else if( !strcasecmp( psz_name, "musicbrainz_artistid" ) )
vlc_meta_SetArtistID( p_item, psz_value );
else if( !strcasecmp( psz_name, "musicbrainz_albumid" ) )
input_item_SetAlbumID( p_item, psz_value );
#endif
}
#endif
if
(
!
p_dec
->
p_description
)
p_dec
->
p_description
=
vlc_meta_New
();
if
(
p_dec
->
p_description
)
vlc_meta_AddExtra
(
p_dec
->
p_description
,
psz_name
,
psz_value
);
if
(
!
strcasecmp
(
psz_name
,
"REPLAYGAIN_TRACK_GAIN"
)
||
!
strcasecmp
(
psz_name
,
"RG_RADIO"
)
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment