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
c99738f0
Commit
c99738f0
authored
Jan 11, 2013
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec audio: factorize error case
parent
46d2b129
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
19 deletions
+13
-19
modules/codec/avcodec/audio.c
modules/codec/avcodec/audio.c
+13
-19
No files found.
modules/codec/avcodec/audio.c
View file @
c99738f0
...
...
@@ -278,22 +278,20 @@ block_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
if
(
ffmpeg_OpenCodec
(
p_dec
)
)
msg_Err
(
p_dec
,
"Cannot open decoder %s"
,
p_sys
->
psz_namecodec
);
}
if
(
p_sys
->
b_delayed_open
)
{
block_Release
(
p_block
);
return
NULL
;
}
goto
end
;
if
(
p_block
->
i_flags
&
(
BLOCK_FLAG_DISCONTINUITY
|
BLOCK_FLAG_CORRUPTED
)
)
{
block_Release
(
p_block
);
avcodec_flush_buffers
(
p_sys
->
p_context
);
p_sys
->
i_samples
=
0
;
date_Set
(
&
p_sys
->
end_date
,
0
);
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
;
goto
end
;
}
if
(
p_sys
->
i_samples
>
0
)
...
...
@@ -304,18 +302,12 @@ block_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
return
p_buffer
;
}
/* We've just started the stream, wait for the first PTS. */
if
(
!
date_Get
(
&
p_sys
->
end_date
)
&&
!
p_block
->
i_pts
)
{
/* We've just started the stream, wait for the first PTS. */
block_Release
(
p_block
);
return
NULL
;
}
goto
end
;
if
(
p_block
->
i_buffer
<=
0
)
{
block_Release
(
p_block
);
return
NULL
;
}
goto
end
;
if
(
(
p_block
->
i_flags
&
BLOCK_FLAG_PRIVATE_REALLOCATED
)
==
0
)
{
...
...
@@ -350,8 +342,7 @@ block_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
msg_Warn
(
p_dec
,
"cannot decode one frame (%zu bytes)"
,
p_block
->
i_buffer
);
block_Release
(
p_block
);
return
NULL
;
goto
end
;
}
else
if
(
(
size_t
)
i_used
>
p_block
->
i_buffer
)
{
...
...
@@ -368,8 +359,7 @@ block_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
{
msg_Warn
(
p_dec
,
"invalid audio properties channels count %d, sample rate %d"
,
p_sys
->
p_context
->
channels
,
p_sys
->
p_context
->
sample_rate
);
block_Release
(
p_block
);
return
NULL
;
goto
end
;
}
if
(
p_dec
->
fmt_out
.
audio
.
i_rate
!=
(
unsigned
int
)
p_sys
->
p_context
->
sample_rate
)
...
...
@@ -402,6 +392,10 @@ block_t * DecodeAudio ( decoder_t *p_dec, block_t **pp_block )
p_buffer
=
SplitBuffer
(
p_dec
);
if
(
!
p_buffer
)
block_Release
(
p_block
);
return
p_buffer
;
end:
block_Release
(
p_block
);
return
NULL
;
}
/*****************************************************************************
...
...
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