Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
c11157c0
Unverified
Commit
c11157c0
authored
8 years ago
by
Rodger Combs
Browse files
Options
Downloads
Patches
Plain Diff
lavf/audiotoolboxdec: only send extradata for formats that use it
Fixes initialization errors for some AVI files
parent
acd5910e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavcodec/audiotoolboxdec.c
+10
-3
10 additions, 3 deletions
libavcodec/audiotoolboxdec.c
with
10 additions
and
3 deletions
libavcodec/audiotoolboxdec.c
+
10
−
3
View file @
c11157c0
...
@@ -261,10 +261,17 @@ static uint8_t* ffat_get_magic_cookie(AVCodecContext *avctx, UInt32 *cookie_size
...
@@ -261,10 +261,17 @@ static uint8_t* ffat_get_magic_cookie(AVCodecContext *avctx, UInt32 *cookie_size
}
}
}
}
static
av_cold
int
ffat_usable_extradata
(
AVCodecContext
*
avctx
)
{
return
avctx
->
extradata_size
&&
(
avctx
->
codec_id
==
AV_CODEC_ID_ALAC
||
avctx
->
codec_id
==
AV_CODEC_ID_AAC
);
}
static
int
ffat_set_extradata
(
AVCodecContext
*
avctx
)
static
int
ffat_set_extradata
(
AVCodecContext
*
avctx
)
{
{
ATDecodeContext
*
at
=
avctx
->
priv_data
;
ATDecodeContext
*
at
=
avctx
->
priv_data
;
if
(
avctx
->
extradata
_size
)
{
if
(
ffat_usable_
extradata
(
avctx
)
)
{
OSStatus
status
;
OSStatus
status
;
UInt32
cookie_size
;
UInt32
cookie_size
;
uint8_t
*
cookie
=
ffat_get_magic_cookie
(
avctx
,
&
cookie_size
);
uint8_t
*
cookie
=
ffat_get_magic_cookie
(
avctx
,
&
cookie_size
);
...
@@ -305,7 +312,7 @@ static av_cold int ffat_create_decoder(AVCodecContext *avctx, AVPacket *pkt)
...
@@ -305,7 +312,7 @@ static av_cold int ffat_create_decoder(AVCodecContext *avctx, AVPacket *pkt)
avctx
->
sample_fmt
=
sample_fmt
;
avctx
->
sample_fmt
=
sample_fmt
;
if
(
avctx
->
extradata
)
{
if
(
ffat_usable_
extradata
(
avctx
)
)
{
UInt32
format_size
=
sizeof
(
in_format
);
UInt32
format_size
=
sizeof
(
in_format
);
UInt32
cookie_size
;
UInt32
cookie_size
;
uint8_t
*
cookie
=
ffat_get_magic_cookie
(
avctx
,
&
cookie_size
);
uint8_t
*
cookie
=
ffat_get_magic_cookie
(
avctx
,
&
cookie_size
);
...
@@ -384,7 +391,7 @@ static av_cold int ffat_create_decoder(AVCodecContext *avctx, AVPacket *pkt)
...
@@ -384,7 +391,7 @@ static av_cold int ffat_create_decoder(AVCodecContext *avctx, AVPacket *pkt)
static
av_cold
int
ffat_init_decoder
(
AVCodecContext
*
avctx
)
static
av_cold
int
ffat_init_decoder
(
AVCodecContext
*
avctx
)
{
{
if
((
avctx
->
channels
&&
avctx
->
sample_rate
)
||
avctx
->
extradata
_size
)
if
((
avctx
->
channels
&&
avctx
->
sample_rate
)
||
ffat_usable_
extradata
(
avctx
)
)
return
ffat_create_decoder
(
avctx
,
NULL
);
return
ffat_create_decoder
(
avctx
,
NULL
);
else
else
return
0
;
return
0
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment