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
3d98df16
Commit
3d98df16
authored
Oct 23, 2008
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed segfault with decoder_GetInputAttachments/GetDisplayDate/GetDisplayRate.
parent
a0bc270c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
34 deletions
+59
-34
include/vlc_codec.h
include/vlc_codec.h
+16
-7
src/input/decoder.c
src/input/decoder.c
+43
-26
src/libvlccore.sym
src/libvlccore.sym
+0
-1
No files found.
include/vlc_codec.h
View file @
3d98df16
...
...
@@ -99,6 +99,22 @@ struct decoder_t
subpicture_t
*
(
*
pf_spu_buffer_new
)
(
decoder_t
*
);
void
(
*
pf_spu_buffer_del
)
(
decoder_t
*
,
subpicture_t
*
);
/*
* Owner fields
*/
/* Input attachments
* XXX use decoder_GetInputAttachments */
int
(
*
pf_get_attachments
)(
decoder_t
*
p_dec
,
input_attachment_t
***
ppp_attachment
,
int
*
pi_attachment
);
/* Display date
* XXX use decoder_GetDisplayDate */
mtime_t
(
*
pf_get_display_date
)(
decoder_t
*
,
mtime_t
);
/* Display rate
* XXX use decoder_GetDisplayRate */
int
(
*
pf_get_display_rate
)(
decoder_t
*
);
/* Private structure for the owner of the decoder */
decoder_owner_sys_t
*
p_owner
;
};
...
...
@@ -147,13 +163,6 @@ struct encoder_t
* @}
*/
/**
* This function returns a specific input attachment (using its name).
*
* You MUST release the returned value.
*/
VLC_EXPORT
(
input_attachment_t
*
,
decoder_GetInputAttachment
,
(
decoder_t
*
,
const
char
*
psz_name
)
LIBVLC_USED
);
/**
* This function gives all input attachments at once.
*
...
...
src/input/decoder.c
View file @
3d98df16
...
...
@@ -162,50 +162,34 @@ struct decoder_owner_sys_t
* Public functions
*****************************************************************************/
/* decoder_GetInputAttachment:
*/
input_attachment_t
*
decoder_GetInputAttachment
(
decoder_t
*
p_dec
,
const
char
*
psz_name
)
{
input_attachment_t
*
p_attachment
;
if
(
input_Control
(
p_dec
->
p_owner
->
p_input
,
INPUT_GET_ATTACHMENT
,
&
p_attachment
,
psz_name
)
)
return
NULL
;
return
p_attachment
;
}
/* decoder_GetInputAttachments:
*/
int
decoder_GetInputAttachments
(
decoder_t
*
p_dec
,
input_attachment_t
***
ppp_attachment
,
int
*
pi_attachment
)
{
return
input_Control
(
p_dec
->
p_owner
->
p_input
,
INPUT_GET_ATTACHMENTS
,
ppp_attachment
,
pi_attachment
);
if
(
!
p_dec
->
pf_get_attachments
)
return
VLC_EGENERIC
;
return
p_dec
->
pf_get_attachments
(
p_dec
,
ppp_attachment
,
pi_attachment
);
}
/* decoder_GetDisplayDate:
*/
mtime_t
decoder_GetDisplayDate
(
decoder_t
*
p_dec
,
mtime_t
i_ts
)
{
decoder_owner_sys_t
*
p_owner
=
p_dec
->
p_owner
;
vlc_mutex_lock
(
&
p_owner
->
lock
);
if
(
p_owner
->
b_buffering
||
p_owner
->
b_paused
)
i_ts
=
0
;
vlc_mutex_unlock
(
&
p_owner
->
lock
);
if
(
!
p_owner
->
p_clock
||
!
i_ts
)
return
i_ts
;
if
(
!
p_dec
->
pf_get_display_date
)
return
0
;
return
input_clock_GetTS
(
p_owner
->
p_clock
,
NULL
,
p_owner
->
p_input
->
i_pts_delay
,
i_ts
);
return
p_dec
->
pf_get_display_date
(
p_dec
,
i_ts
);
}
/* decoder_GetDisplayRate:
*/
int
decoder_GetDisplayRate
(
decoder_t
*
p_dec
)
{
decoder_owner_sys_t
*
p_owner
=
p_dec
->
p_owner
;
if
(
!
p_owner
->
p_clock
)
if
(
!
p_dec
->
pf_get_display_rate
)
return
INPUT_RATE_DEFAULT
;
return
input_clock_GetRate
(
p_owner
->
p_clock
);
return
p_dec
->
pf_get_display_rate
(
p_dec
);
}
/**
...
...
@@ -560,6 +544,35 @@ void input_DecoderFrameNext( decoder_t *p_dec, mtime_t *pi_duration )
/*****************************************************************************
* Internal functions
*****************************************************************************/
static
int
DecoderGetInputAttachments
(
decoder_t
*
p_dec
,
input_attachment_t
***
ppp_attachment
,
int
*
pi_attachment
)
{
return
input_Control
(
p_dec
->
p_owner
->
p_input
,
INPUT_GET_ATTACHMENTS
,
ppp_attachment
,
pi_attachment
);
}
static
mtime_t
DecoderGetDisplayDate
(
decoder_t
*
p_dec
,
mtime_t
i_ts
)
{
decoder_owner_sys_t
*
p_owner
=
p_dec
->
p_owner
;
vlc_mutex_lock
(
&
p_owner
->
lock
);
if
(
p_owner
->
b_buffering
||
p_owner
->
b_paused
)
i_ts
=
0
;
vlc_mutex_unlock
(
&
p_owner
->
lock
);
if
(
!
p_owner
->
p_clock
||
!
i_ts
)
return
i_ts
;
return
input_clock_GetTS
(
p_owner
->
p_clock
,
NULL
,
p_owner
->
p_input
->
i_pts_delay
,
i_ts
);
}
static
int
DecoderGetDisplayRate
(
decoder_t
*
p_dec
)
{
decoder_owner_sys_t
*
p_owner
=
p_dec
->
p_owner
;
if
(
!
p_owner
->
p_clock
)
return
INPUT_RATE_DEFAULT
;
return
input_clock_GetRate
(
p_owner
->
p_clock
);
}
/* */
static
void
DecoderUnsupportedCodec
(
decoder_t
*
p_dec
,
vlc_fourcc_t
codec
)
...
...
@@ -642,6 +655,10 @@ static decoder_t * CreateDecoder( input_thread_t *p_input,
p_dec
->
pf_picture_unlink
=
vout_unlink_picture
;
p_dec
->
pf_spu_buffer_new
=
spu_new_buffer
;
p_dec
->
pf_spu_buffer_del
=
spu_del_buffer
;
/* */
p_dec
->
pf_get_attachments
=
DecoderGetInputAttachments
;
p_dec
->
pf_get_display_date
=
DecoderGetDisplayDate
;
p_dec
->
pf_get_display_rate
=
DecoderGetDisplayRate
;
vlc_object_attach
(
p_dec
,
p_input
);
...
...
src/libvlccore.sym
View file @
3d98df16
...
...
@@ -79,7 +79,6 @@ date_Move
date_Set
decoder_GetDisplayDate
decoder_GetDisplayRate
decoder_GetInputAttachment
decoder_GetInputAttachments
decoder_SynchroChoose
decoder_SynchroDate
...
...
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