Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
c23152a9
Commit
c23152a9
authored
Feb 09, 2016
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avplay: convert do codecpar
parent
0705f596
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
avplay.c
avplay.c
+12
-12
No files found.
avplay.c
View file @
c23152a9
...
...
@@ -2017,11 +2017,11 @@ static AVCodec *choose_decoder(PlayerState *is, AVFormatContext *ic, AVStream *s
}
if
(
codec_name
)
{
AVCodec
*
codec
=
find_codec_or_die
(
codec_name
,
st
->
codec
->
codec_type
);
st
->
codec
->
codec_id
=
codec
->
id
;
AVCodec
*
codec
=
find_codec_or_die
(
codec_name
,
st
->
codec
par
->
codec_type
);
st
->
codec
par
->
codec_id
=
codec
->
id
;
return
codec
;
}
else
return
avcodec_find_decoder
(
st
->
codec
->
codec_id
);
return
avcodec_find_decoder
(
st
->
codec
par
->
codec_id
);
}
/* open a given stream. Return 0 if OK */
...
...
@@ -2042,7 +2042,7 @@ static int stream_component_open(PlayerState *is, int stream_index)
if
(
!
avctx
)
return
AVERROR
(
ENOMEM
);
ret
=
avcodec_
copy_context
(
avctx
,
ic
->
streams
[
stream_index
]
->
codec
);
ret
=
avcodec_
parameters_to_context
(
avctx
,
ic
->
streams
[
stream_index
]
->
codecpar
);
if
(
ret
<
0
)
{
avcodec_free_context
(
&
avctx
);
return
ret
;
...
...
@@ -2160,13 +2160,13 @@ fail:
static
void
stream_component_close
(
PlayerState
*
is
,
int
stream_index
)
{
AVFormatContext
*
ic
=
is
->
ic
;
AVCodec
Context
*
avctx
;
AVCodec
Parameters
*
par
;
if
(
stream_index
<
0
||
stream_index
>=
ic
->
nb_streams
)
return
;
avctx
=
ic
->
streams
[
stream_index
]
->
codec
;
par
=
ic
->
streams
[
stream_index
]
->
codecpar
;
switch
(
avctx
->
codec_type
)
{
switch
(
par
->
codec_type
)
{
case
AVMEDIA_TYPE_AUDIO
:
packet_queue_abort
(
&
is
->
audioq
);
...
...
@@ -2220,7 +2220,7 @@ static void stream_component_close(PlayerState *is, int stream_index)
}
ic
->
streams
[
stream_index
]
->
discard
=
AVDISCARD_ALL
;
switch
(
avctx
->
codec_type
)
{
switch
(
par
->
codec_type
)
{
case
AVMEDIA_TYPE_AUDIO
:
avcodec_free_context
(
&
is
->
audio_dec
);
is
->
audio_st
=
NULL
;
...
...
@@ -2311,7 +2311,7 @@ static int stream_setup(PlayerState *is)
orig_nb_streams
=
ic
->
nb_streams
;
for
(
i
=
0
;
i
<
ic
->
nb_streams
;
i
++
)
ic
->
streams
[
i
]
->
codec
->
codec
=
choose_decoder
(
is
,
ic
,
ic
->
streams
[
i
]);
choose_decoder
(
is
,
ic
,
ic
->
streams
[
i
]);
err
=
avformat_find_stream_info
(
ic
,
opts
);
...
...
@@ -2596,12 +2596,12 @@ static void stream_cycle_channel(PlayerState *is, int codec_type)
if
(
stream_index
==
start_index
)
return
;
st
=
ic
->
streams
[
stream_index
];
if
(
st
->
codec
->
codec_type
==
codec_type
)
{
if
(
st
->
codec
par
->
codec_type
==
codec_type
)
{
/* check that parameters are OK */
switch
(
codec_type
)
{
case
AVMEDIA_TYPE_AUDIO
:
if
(
st
->
codec
->
sample_rate
!=
0
&&
st
->
codec
->
channels
!=
0
)
if
(
st
->
codec
par
->
sample_rate
!=
0
&&
st
->
codec
par
->
channels
!=
0
)
goto
the_end
;
break
;
case
AVMEDIA_TYPE_VIDEO
:
...
...
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