Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/ffmpeg.c b/ffmpeg.c
- index b962d5e..c60b330 100644
- --- a/ffmpeg.c
- +++ b/ffmpeg.c
- @@ -750,6 +750,7 @@ static void close_output_stream(OutputStream *ost)
- static void output_packet(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
- {
- int ret = 0;
- + static int done = 0;
- /* apply the output bitstream filters, if any */
- if (ost->nb_bitstream_filters) {
- @@ -782,6 +783,19 @@ static void output_packet(AVFormatContext *s, AVPacket *pkt, OutputStream *ost)
- } else
- write_packet(s, pkt, ost);
- + if (!done) {
- + if(ost->nb_bitstream_filters && ost->bsf_ctx[0]->par_out->extradata_size) {
- + av_freep(&ost->st->codecpar->extradata);
- + ost->st->codecpar->extradata_size = 0;
- + ost->st->codecpar->extradata = av_mallocz(ost->bsf_ctx[0]->par_out->extradata_size + AV_INPUT_BUFFER_PADDING_SIZE);
- + if (!ost->st->codecpar->extradata)
- + goto finish;
- + memcpy(ost->st->codecpar->extradata, ost->bsf_ctx[0]->par_out->extradata, ost->bsf_ctx[0]->par_out->extradata_size);
- + ost->st->codecpar->extradata_size = ost->bsf_ctx[0]->par_out->extradata_size;
- + }
- + done = 1;
- + }
- +
- finish:
- if (ret < 0 && ret != AVERROR_EOF) {
- av_log(NULL, AV_LOG_FATAL, "Error applying bitstream filters to an output "
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement