Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
ffmpeg
Commits
68383594
Commit
68383594
authored
Apr 16, 2018
by
James Almer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/flacenc: add flac_init()
Signed-off-by:
James Almer
<
jamrial@gmail.com
>
parent
00d8598e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
10 deletions
+20
-10
flacenc.c
libavformat/flacenc.c
+20
-10
No files found.
libavformat/flacenc.c
View file @
68383594
...
@@ -199,11 +199,11 @@ static int flac_finish_header(struct AVFormatContext *s)
...
@@ -199,11 +199,11 @@ static int flac_finish_header(struct AVFormatContext *s)
return
0
;
return
0
;
}
}
static
int
flac_
write_header
(
struct
AVFormatContext
*
s
)
static
int
flac_
init
(
struct
AVFormatContext
*
s
)
{
{
AVCodecParameters
*
par
;
AVCodecParameters
*
par
;
FlacMuxerContext
*
c
=
s
->
priv_data
;
FlacMuxerContext
*
c
=
s
->
priv_data
;
int
ret
,
i
;
int
i
;
c
->
audio_stream_idx
=
-
1
;
c
->
audio_stream_idx
=
-
1
;
for
(
i
=
0
;
i
<
s
->
nb_streams
;
i
++
)
{
for
(
i
=
0
;
i
<
s
->
nb_streams
;
i
++
)
{
...
@@ -238,14 +238,6 @@ static int flac_write_header(struct AVFormatContext *s)
...
@@ -238,14 +238,6 @@ static int flac_write_header(struct AVFormatContext *s)
return
AVERROR
(
EINVAL
);
return
AVERROR
(
EINVAL
);
}
}
if
(
!
c
->
write_header
)
return
0
;
ret
=
ff_flac_write_header
(
s
->
pb
,
par
->
extradata
,
par
->
extradata_size
,
0
);
if
(
ret
)
return
ret
;
/* add the channel layout tag */
/* add the channel layout tag */
if
(
par
->
channel_layout
&&
if
(
par
->
channel_layout
&&
!
(
par
->
channel_layout
&
~
0x3ffffULL
)
&&
!
(
par
->
channel_layout
&
~
0x3ffffULL
)
&&
...
@@ -263,6 +255,23 @@ static int flac_write_header(struct AVFormatContext *s)
...
@@ -263,6 +255,23 @@ static int flac_write_header(struct AVFormatContext *s)
}
}
}
}
return
0
;
}
static
int
flac_write_header
(
struct
AVFormatContext
*
s
)
{
FlacMuxerContext
*
c
=
s
->
priv_data
;
AVCodecParameters
*
par
=
s
->
streams
[
c
->
audio_stream_idx
]
->
codecpar
;
int
ret
;
if
(
!
c
->
write_header
)
return
0
;
ret
=
ff_flac_write_header
(
s
->
pb
,
par
->
extradata
,
par
->
extradata_size
,
0
);
if
(
ret
<
0
)
return
ret
;
if
(
!
c
->
waiting_pics
)
if
(
!
c
->
waiting_pics
)
ret
=
flac_finish_header
(
s
);
ret
=
flac_finish_header
(
s
);
...
@@ -412,6 +421,7 @@ AVOutputFormat ff_flac_muxer = {
...
@@ -412,6 +421,7 @@ AVOutputFormat ff_flac_muxer = {
.
extensions
=
"flac"
,
.
extensions
=
"flac"
,
.
audio_codec
=
AV_CODEC_ID_FLAC
,
.
audio_codec
=
AV_CODEC_ID_FLAC
,
.
video_codec
=
AV_CODEC_ID_PNG
,
.
video_codec
=
AV_CODEC_ID_PNG
,
.
init
=
flac_init
,
.
write_header
=
flac_write_header
,
.
write_header
=
flac_write_header
,
.
write_packet
=
flac_write_packet
,
.
write_packet
=
flac_write_packet
,
.
write_trailer
=
flac_write_trailer
,
.
write_trailer
=
flac_write_trailer
,
...
...
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