Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
1fc3e360
Commit
1fc3e360
authored
Jun 04, 2007
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Silent first 3 mpeg audio frames after a discontinuity. (Avoid glitch on seeks/errors)
parent
9507195d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
20 deletions
+25
-20
modules/codec/ffmpeg/audio.c
modules/codec/ffmpeg/audio.c
+16
-7
modules/codec/ffmpeg/ffmpeg.c
modules/codec/ffmpeg/ffmpeg.c
+1
-6
modules/codec/ffmpeg/ffmpeg.h
modules/codec/ffmpeg/ffmpeg.h
+7
-0
modules/codec/ffmpeg/video.c
modules/codec/ffmpeg/video.c
+1
-7
No files found.
modules/codec/ffmpeg/audio.c
View file @
1fc3e360
...
...
@@ -56,12 +56,7 @@ static unsigned int pi_channels_maps[7] =
*****************************************************************************/
struct
decoder_sys_t
{
/* Common part between video and audio decoder */
int
i_cat
;
int
i_codec_id
;
const
char
*
psz_namecodec
;
AVCodecContext
*
p_context
;
AVCodec
*
p_codec
;
FFMPEG_COMMON_MEMBERS
/* Temporary buffer for libavcodec */
uint8_t
*
p_output
;
...
...
@@ -77,6 +72,9 @@ struct decoder_sys_t
*/
uint8_t
*
p_samples
;
int
i_samples
;
/* */
int
i_reject_count
;
};
/*****************************************************************************
...
...
@@ -147,6 +145,7 @@ int E_(InitAudioDec)( decoder_t *p_dec, AVCodecContext *p_context,
p_sys
->
p_output
=
malloc
(
AVCODEC_MAX_AUDIO_FRAME_SIZE
);
p_sys
->
p_samples
=
NULL
;
p_sys
->
i_samples
=
0
;
p_sys
->
i_reject_count
=
0
;
aout_DateSet
(
&
p_sys
->
end_date
,
0
);
if
(
p_dec
->
fmt_in
.
audio
.
i_rate
)
...
...
@@ -207,6 +206,9 @@ aout_buffer_t *E_( DecodeAudio )( decoder_t *p_dec, block_t **pp_block )
{
block_Release
(
p_block
);
avcodec_flush_buffers
(
p_sys
->
p_context
);
if
(
p_sys
->
i_codec_id
==
CODEC_ID_MP2
||
p_sys
->
i_codec_id
==
CODEC_ID_MP3
)
p_sys
->
i_reject_count
=
3
;
return
NULL
;
}
...
...
@@ -293,9 +295,16 @@ aout_buffer_t *E_( DecodeAudio )( decoder_t *p_dec, block_t **pp_block )
p_block
->
i_pts
=
0
;
/* **** Now we can output these samples **** */
p_sys
->
i_samples
=
i_output
/
2
/
p_sys
->
p_context
->
channels
;
p_sys
->
i_samples
=
i_output
/
sizeof
(
int16_t
)
/
p_sys
->
p_context
->
channels
;
p_sys
->
p_samples
=
p_sys
->
p_output
;
/* Silent unwanted samples */
if
(
p_sys
->
i_reject_count
>
0
)
{
memset
(
p_sys
->
p_output
,
0
,
i_output
);
p_sys
->
i_reject_count
--
;
}
p_buffer
=
SplitBuffer
(
p_dec
);
if
(
!
p_buffer
)
block_Release
(
p_block
);
return
p_buffer
;
...
...
modules/codec/ffmpeg/ffmpeg.c
View file @
1fc3e360
...
...
@@ -54,12 +54,7 @@
struct
decoder_sys_t
{
/* Common part between video and audio decoder */
int
i_cat
;
int
i_codec_id
;
char
*
psz_namecodec
;
AVCodecContext
*
p_context
;
AVCodec
*
p_codec
;
FFMPEG_COMMON_MEMBERS
};
/****************************************************************************
...
...
modules/codec/ffmpeg/ffmpeg.h
View file @
1fc3e360
...
...
@@ -302,3 +302,10 @@ N_("<filterName>[:<option>[:<option>...]][[,|/][-]<filterName>[:<option>...]]...
#define MUX_TEXT N_("Ffmpeg mux")
#define MUX_LONGTEXT N_("Force use of ffmpeg muxer.")
#define FFMPEG_COMMON_MEMBERS \
int i_cat; \
int i_codec_id; \
char *psz_namecodec; \
AVCodecContext *p_context; \
AVCodec *p_codec;
modules/codec/ffmpeg/video.c
View file @
1fc3e360
...
...
@@ -44,13 +44,7 @@
*****************************************************************************/
struct
decoder_sys_t
{
/* Common part between video and audio decoder */
int
i_cat
;
int
i_codec_id
;
const
char
*
psz_namecodec
;
AVCodecContext
*
p_context
;
AVCodec
*
p_codec
;
FFMPEG_COMMON_MEMBERS
/* Video decoder specific part */
mtime_t
input_pts
;
...
...
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