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
662af912
Commit
662af912
authored
Nov 21, 2003
by
Gildas Bazin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* modules/demux/flac.c, modules/codec/flac.c: couple of fixes.
parent
9b889a6a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
7 deletions
+17
-7
modules/codec/flac.c
modules/codec/flac.c
+13
-3
modules/demux/flac.c
modules/demux/flac.c
+4
-4
No files found.
modules/codec/flac.c
View file @
662af912
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* flac.c: flac decoder/packetizer module making use of libflac
* flac.c: flac decoder/packetizer module making use of libflac
*****************************************************************************
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* Copyright (C) 1999-2001 VideoLAN
* $Id: flac.c,v 1.
1 2003/11/21 01:45:48
gbazin Exp $
* $Id: flac.c,v 1.
2 2003/11/21 12:18:54
gbazin Exp $
*
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
* Authors: Gildas Bazin <gbazin@netcourrier.com>
* Sigmund Augdal <sigmunau@idi.ntnu.no>
* Sigmund Augdal <sigmunau@idi.ntnu.no>
...
@@ -404,7 +404,17 @@ static aout_buffer_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
...
@@ -404,7 +404,17 @@ static aout_buffer_t *DecodeBlock( decoder_t *p_dec, block_t **pp_block )
{
{
decoder_state_error
(
p_dec
,
decoder_state_error
(
p_dec
,
FLAC__stream_decoder_get_state
(
p_sys
->
p_flac
)
);
FLAC__stream_decoder_get_state
(
p_sys
->
p_flac
)
);
FLAC__stream_decoder_flush
(
p_dec
->
p_sys
->
p_flac
);
}
}
/* If the decoder is in the "aborted" state,
* FLAC__stream_decoder_process_single() won't return an error. */
if
(
FLAC__stream_decoder_get_state
(
p_dec
->
p_sys
->
p_flac
)
==
FLAC__STREAM_DECODER_ABORTED
)
{
FLAC__stream_decoder_flush
(
p_dec
->
p_sys
->
p_flac
);
}
block_Release
(
p_sys
->
p_block
);
block_Release
(
p_sys
->
p_block
);
}
}
...
@@ -434,7 +444,6 @@ DecoderReadCallback( const FLAC__StreamDecoder *decoder, FLAC__byte buffer[],
...
@@ -434,7 +444,6 @@ DecoderReadCallback( const FLAC__StreamDecoder *decoder, FLAC__byte buffer[],
decoder_t
*
p_dec
=
(
decoder_t
*
)
client_data
;
decoder_t
*
p_dec
=
(
decoder_t
*
)
client_data
;
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
decoder_sys_t
*
p_sys
=
p_dec
->
p_sys
;
msg_Err
(
p_dec
,
"buffer: %i"
,
p_sys
->
p_block
->
i_buffer
);
if
(
p_sys
->
p_block
&&
p_sys
->
p_block
->
i_buffer
)
if
(
p_sys
->
p_block
&&
p_sys
->
p_block
->
i_buffer
)
{
{
*
bytes
=
__MIN
(
*
bytes
,
(
unsigned
)
p_sys
->
p_block
->
i_buffer
);
*
bytes
=
__MIN
(
*
bytes
,
(
unsigned
)
p_sys
->
p_block
->
i_buffer
);
...
@@ -570,6 +579,8 @@ static void DecoderErrorCallback( const FLAC__StreamDecoder *decoder,
...
@@ -570,6 +579,8 @@ static void DecoderErrorCallback( const FLAC__StreamDecoder *decoder,
default:
default:
msg_Err
(
p_dec
,
"got decoder error: %d"
,
status
);
msg_Err
(
p_dec
,
"got decoder error: %d"
,
status
);
}
}
FLAC__stream_decoder_flush
(
p_dec
->
p_sys
->
p_flac
);
return
;
return
;
}
}
...
@@ -633,7 +644,6 @@ static void decoder_state_error( decoder_t *p_dec,
...
@@ -633,7 +644,6 @@ static void decoder_state_error( decoder_t *p_dec,
case
FLAC__STREAM_DECODER_UNPARSEABLE_STREAM
:
case
FLAC__STREAM_DECODER_UNPARSEABLE_STREAM
:
msg_Err
(
p_dec
,
"The decoder encountered reserved fields in use "
msg_Err
(
p_dec
,
"The decoder encountered reserved fields in use "
"in the stream."
);
"in the stream."
);
FLAC__stream_decoder_flush
(
p_dec
->
p_sys
->
p_flac
);
break
;
break
;
case
FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR
:
case
FLAC__STREAM_DECODER_MEMORY_ALLOCATION_ERROR
:
msg_Err
(
p_dec
,
"An error occurred allocating memory."
);
msg_Err
(
p_dec
,
"An error occurred allocating memory."
);
...
...
modules/demux/flac.c
View file @
662af912
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
* flac.c : FLAC demux module for vlc
* flac.c : FLAC demux module for vlc
*****************************************************************************
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* Copyright (C) 2001 VideoLAN
* $Id: flac.c,v 1.
6 2003/11/21 01:45:48
gbazin Exp $
* $Id: flac.c,v 1.
7 2003/11/21 12:18:54
gbazin Exp $
*
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
* Authors: Gildas Bazin <gbazin@netcourrier.com>
*
*
...
@@ -131,13 +131,13 @@ static int Open( vlc_object_t * p_this )
...
@@ -131,13 +131,13 @@ static int Open( vlc_object_t * p_this )
es_format_Init
(
&
p_sys
->
p_packetizer
->
fmt_in
,
AUDIO_ES
,
es_format_Init
(
&
p_sys
->
p_packetizer
->
fmt_in
,
AUDIO_ES
,
VLC_FOURCC
(
'f'
,
'l'
,
'a'
,
'c'
)
);
VLC_FOURCC
(
'f'
,
'l'
,
'a'
,
'c'
)
);
/* Store STREAMINFO for the decoder an packetizer */
/* Store STREAMINFO for the decoder an
d
packetizer */
p_sys
->
p_packetizer
->
fmt_in
.
i_extra
=
fmt
.
i_extra
=
STREAMINFO_SIZE
;
p_sys
->
p_packetizer
->
fmt_in
.
i_extra
=
fmt
.
i_extra
=
STREAMINFO_SIZE
;
p_sys
->
p_packetizer
->
fmt_in
.
p_extra
=
malloc
(
STREAMINFO_SIZE
);
p_sys
->
p_packetizer
->
fmt_in
.
p_extra
=
malloc
(
STREAMINFO_SIZE
);
stream_Read
(
p_input
->
s
,
p_sys
->
p_packetizer
->
fmt_in
.
p_extra
,
stream_Read
(
p_input
->
s
,
p_sys
->
p_packetizer
->
fmt_in
.
p_extra
,
STREAMINFO_SIZE
);
STREAMINFO_SIZE
);
/* Fake this a the last metadata block */
/* Fake this a
s
the last metadata block */
((
uint8_t
*
)
p_sys
->
p_packetizer
->
fmt_in
.
p_extra
)[
0
]
|=
0x80
;
((
uint8_t
*
)
p_sys
->
p_packetizer
->
fmt_in
.
p_extra
)[
0
]
|=
0x80
;
fmt
.
p_extra
=
malloc
(
STREAMINFO_SIZE
);
fmt
.
p_extra
=
malloc
(
STREAMINFO_SIZE
);
memcpy
(
fmt
.
p_extra
,
p_sys
->
p_packetizer
->
fmt_in
.
p_extra
,
STREAMINFO_SIZE
);
memcpy
(
fmt
.
p_extra
,
p_sys
->
p_packetizer
->
fmt_in
.
p_extra
,
STREAMINFO_SIZE
);
...
@@ -179,7 +179,7 @@ static void Close( vlc_object_t * p_this )
...
@@ -179,7 +179,7 @@ static void Close( vlc_object_t * p_this )
demux_sys_t
*
p_sys
=
p_input
->
p_demux_data
;
demux_sys_t
*
p_sys
=
p_input
->
p_demux_data
;
/* Unneed module */
/* Unneed module */
module_Unneed
(
p_
input
,
p_sys
->
p_packetizer
->
p_module
);
module_Unneed
(
p_
sys
->
p_packetizer
,
p_sys
->
p_packetizer
->
p_module
);
if
(
p_sys
->
p_packetizer
->
fmt_in
.
p_extra
)
if
(
p_sys
->
p_packetizer
->
fmt_in
.
p_extra
)
free
(
p_sys
->
p_packetizer
->
fmt_in
.
p_extra
);
free
(
p_sys
->
p_packetizer
->
fmt_in
.
p_extra
);
...
...
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