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
7f886720
Commit
7f886720
authored
Apr 11, 2010
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Interpolate audio date in flac decoder.
It closes #3509.
parent
3fb4d657
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
3 deletions
+14
-3
modules/codec/flac.c
modules/codec/flac.c
+14
-3
No files found.
modules/codec/flac.c
View file @
7f886720
...
@@ -55,6 +55,7 @@ struct decoder_sys_t
...
@@ -55,6 +55,7 @@ struct decoder_sys_t
*/
*/
block_t
*
p_block
;
block_t
*
p_block
;
aout_buffer_t
*
p_aout_buffer
;
aout_buffer_t
*
p_aout_buffer
;
date_t
end_date
;
/*
/*
* FLAC properties
* FLAC properties
...
@@ -272,6 +273,10 @@ static aout_buffer_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
...
@@ -272,6 +273,10 @@ static aout_buffer_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
p_sys
->
p_block
=
*
pp_block
;
p_sys
->
p_block
=
*
pp_block
;
*
pp_block
=
NULL
;
*
pp_block
=
NULL
;
if
(
p_sys
->
p_block
->
i_pts
>
VLC_TS_INVALID
&&
p_sys
->
p_block
->
i_pts
!=
date_Get
(
&
p_sys
->
end_date
)
)
date_Set
(
&
p_sys
->
end_date
,
p_sys
->
p_block
->
i_pts
);
p_sys
->
p_aout_buffer
=
0
;
p_sys
->
p_aout_buffer
=
0
;
if
(
!
FLAC__stream_decoder_process_single
(
p_sys
->
p_flac
)
)
if
(
!
FLAC__stream_decoder_process_single
(
p_sys
->
p_flac
)
)
...
@@ -351,6 +356,9 @@ DecoderWriteCallback( const FLAC__StreamDecoder *decoder,
...
@@ -351,6 +356,9 @@ DecoderWriteCallback( const FLAC__StreamDecoder *decoder,
if
(
p_dec
->
fmt_out
.
audio
.
i_channels
<=
0
||
if
(
p_dec
->
fmt_out
.
audio
.
i_channels
<=
0
||
p_dec
->
fmt_out
.
audio
.
i_channels
>
8
)
p_dec
->
fmt_out
.
audio
.
i_channels
>
8
)
return
FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE
;
return
FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE
;
if
(
date_Get
(
&
p_sys
->
end_date
)
<=
VLC_TS_INVALID
)
return
FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE
;
const
int
*
const
pi_reorder
=
ppi_reorder
[
p_dec
->
fmt_out
.
audio
.
i_channels
];
const
int
*
const
pi_reorder
=
ppi_reorder
[
p_dec
->
fmt_out
.
audio
.
i_channels
];
p_sys
->
p_aout_buffer
=
p_sys
->
p_aout_buffer
=
...
@@ -375,8 +383,10 @@ DecoderWriteCallback( const FLAC__StreamDecoder *decoder,
...
@@ -375,8 +383,10 @@ DecoderWriteCallback( const FLAC__StreamDecoder *decoder,
}
}
/* Date management (already done by packetizer) */
/* Date management (already done by packetizer) */
p_sys
->
p_aout_buffer
->
i_pts
=
p_sys
->
p_block
->
i_pts
;
p_sys
->
p_aout_buffer
->
i_pts
=
date_Get
(
&
p_sys
->
end_date
);
p_sys
->
p_aout_buffer
->
i_length
=
p_sys
->
p_block
->
i_length
;
p_sys
->
p_aout_buffer
->
i_length
=
date_Increment
(
&
p_sys
->
end_date
,
frame
->
header
.
blocksize
)
-
p_sys
->
p_aout_buffer
->
i_pts
;
return
FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE
;
return
FLAC__STREAM_DECODER_WRITE_STATUS_CONTINUE
;
}
}
...
@@ -429,7 +439,8 @@ static void DecoderMetadataCallback( const FLAC__StreamDecoder *decoder,
...
@@ -429,7 +439,8 @@ static void DecoderMetadataCallback( const FLAC__StreamDecoder *decoder,
p_sys
->
b_stream_info
=
true
;
p_sys
->
b_stream_info
=
true
;
p_sys
->
stream_info
=
metadata
->
data
.
stream_info
;
p_sys
->
stream_info
=
metadata
->
data
.
stream_info
;
return
;
date_Init
(
&
p_sys
->
end_date
,
p_dec
->
fmt_out
.
audio
.
i_rate
,
1
);
date_Set
(
&
p_sys
->
end_date
,
VLC_TS_INVALID
);
}
}
/*****************************************************************************
/*****************************************************************************
...
...
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