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
2186305a
Commit
2186305a
authored
Sep 23, 2009
by
Ilkka Ollakka
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avcodec: set codec_id and codec_type in context also
it's checked to match from r19973 on libavcodec
parent
ec24ba1a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
0 deletions
+10
-0
modules/codec/avcodec/audio.c
modules/codec/avcodec/audio.c
+3
-0
modules/codec/avcodec/encoder.c
modules/codec/avcodec/encoder.c
+4
-0
modules/codec/avcodec/video.c
modules/codec/avcodec/video.c
+3
-0
No files found.
modules/codec/avcodec/audio.c
View file @
2186305a
...
...
@@ -96,6 +96,9 @@ int InitAudioDec( decoder_t *p_dec, AVCodecContext *p_context,
return
VLC_ENOMEM
;
}
p_codec
->
type
=
CODEC_TYPE_AUDIO
;
p_context
->
codec_type
=
CODEC_TYPE_AUDIO
;
p_context
->
codec_id
=
i_codec_id
;
p_sys
->
p_context
=
p_context
;
p_sys
->
p_codec
=
p_codec
;
p_sys
->
i_codec_id
=
i_codec_id
;
...
...
modules/codec/avcodec/encoder.c
View file @
2186305a
...
...
@@ -279,6 +279,7 @@ int OpenEncoder( vlc_object_t *p_this )
p_sys
->
i_buffer_out
=
0
;
p_sys
->
p_context
=
p_context
=
avcodec_alloc_context
();
p_sys
->
p_context
->
codec_id
=
p_sys
->
p_codec
->
id
;
p_context
->
debug
=
config_GetInt
(
p_enc
,
"ffmpeg-debug"
);
p_context
->
opaque
=
(
void
*
)
p_this
;
...
...
@@ -426,6 +427,8 @@ int OpenEncoder( vlc_object_t *p_this )
return
VLC_EGENERIC
;
}
p_context
->
codec_type
=
CODEC_TYPE_VIDEO
;
p_context
->
width
=
p_enc
->
fmt_in
.
video
.
i_width
;
p_context
->
height
=
p_enc
->
fmt_in
.
video
.
i_height
;
...
...
@@ -584,6 +587,7 @@ int OpenEncoder( vlc_object_t *p_this )
if
(
i_codec_id
==
CODEC_ID_MP3
&&
p_enc
->
fmt_in
.
audio
.
i_channels
>
2
)
p_enc
->
fmt_in
.
audio
.
i_channels
=
2
;
p_context
->
codec_type
=
CODEC_TYPE_AUDIO
;
p_enc
->
fmt_in
.
i_codec
=
VLC_CODEC_S16N
;
p_context
->
sample_rate
=
p_enc
->
fmt_out
.
audio
.
i_rate
;
p_context
->
channels
=
p_enc
->
fmt_out
.
audio
.
i_channels
;
...
...
modules/codec/avcodec/video.c
View file @
2186305a
...
...
@@ -196,6 +196,9 @@ int InitVideoDec( decoder_t *p_dec, AVCodecContext *p_context,
if
(
(
p_dec
->
p_sys
=
p_sys
=
calloc
(
1
,
sizeof
(
decoder_sys_t
)
)
)
==
NULL
)
return
VLC_ENOMEM
;
p_codec
->
type
=
CODEC_TYPE_VIDEO
;
p_context
->
codec_type
=
CODEC_TYPE_VIDEO
;
p_context
->
codec_id
=
i_codec_id
;
p_sys
->
p_context
=
p_context
;
p_sys
->
p_codec
=
p_codec
;
p_sys
->
i_codec_id
=
i_codec_id
;
...
...
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