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
ed39cda0
Commit
ed39cda0
authored
Apr 29, 2014
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
flacenc: send final extradata in packet side data
parent
0957b274
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
0 deletions
+20
-0
flacenc.c
libavcodec/flacenc.c
+20
-0
No files found.
libavcodec/flacenc.c
View file @
ed39cda0
...
...
@@ -114,6 +114,9 @@ typedef struct FlacEncodeContext {
unsigned
int
md5_buffer_size
;
DSPContext
dsp
;
FLACDSPContext
flac_dsp
;
int
flushed
;
int64_t
next_pts
;
}
FlacEncodeContext
;
...
...
@@ -1212,6 +1215,20 @@ static int flac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
s
->
max_framesize
=
s
->
max_encoded_framesize
;
av_md5_final
(
s
->
md5ctx
,
s
->
md5sum
);
write_streaminfo
(
s
,
avctx
->
extradata
);
if
(
avctx
->
side_data_only_packets
&&
!
s
->
flushed
)
{
uint8_t
*
side_data
=
av_packet_new_side_data
(
avpkt
,
AV_PKT_DATA_NEW_EXTRADATA
,
avctx
->
extradata_size
);
if
(
!
side_data
)
return
AVERROR
(
ENOMEM
);
memcpy
(
side_data
,
avctx
->
extradata
,
avctx
->
extradata_size
);
avpkt
->
pts
=
s
->
next_pts
;
*
got_packet_ptr
=
1
;
s
->
flushed
=
1
;
}
return
0
;
}
...
...
@@ -1264,6 +1281,9 @@ static int flac_encode_frame(AVCodecContext *avctx, AVPacket *avpkt,
avpkt
->
pts
=
frame
->
pts
;
avpkt
->
duration
=
ff_samples_to_time_base
(
avctx
,
frame
->
nb_samples
);
avpkt
->
size
=
out_bytes
;
s
->
next_pts
=
avpkt
->
pts
+
avpkt
->
duration
;
*
got_packet_ptr
=
1
;
return
0
;
}
...
...
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