Browse Source

ffmpeg: stop accessing deprecated stream-embedded codec context

tags/n4.4
Anton Khirnov 4 years ago
parent
commit
50b49f833a
1 changed files with 2 additions and 10 deletions
  1. +2
    -10
      fftools/ffmpeg.c

+ 2
- 10
fftools/ffmpeg.c View File

@@ -3568,12 +3568,6 @@ static int init_output_stream(OutputStream *ost, AVFrame *frame,
"Error initializing the output stream codec context.\n"); "Error initializing the output stream codec context.\n");
exit_program(1); exit_program(1);
} }
/*
* FIXME: ost->st->codec should't be needed here anymore.
*/
ret = avcodec_copy_context(ost->st->codec, ost->enc_ctx);
if (ret < 0)
return ret;


if (ost->enc_ctx->nb_coded_side_data) { if (ost->enc_ctx->nb_coded_side_data) {
int i; int i;
@@ -3618,8 +3612,6 @@ static int init_output_stream(OutputStream *ost, AVFrame *frame,
// copy estimated duration as a hint to the muxer // copy estimated duration as a hint to the muxer
if (ost->st->duration <= 0 && ist && ist->st->duration > 0) if (ost->st->duration <= 0 && ist && ist->st->duration > 0)
ost->st->duration = av_rescale_q(ist->st->duration, ist->st->time_base, ost->st->time_base); ost->st->duration = av_rescale_q(ist->st->duration, ist->st->time_base, ost->st->time_base);

ost->st->codec->codec= ost->enc_ctx->codec;
} else if (ost->stream_copy) { } else if (ost->stream_copy) {
ret = init_output_stream_streamcopy(ost); ret = init_output_stream_streamcopy(ost);
if (ret < 0) if (ret < 0)
@@ -4011,7 +4003,7 @@ static int check_keyboard_interaction(int64_t cur_time)
if (key == 'd' || key == 'D'){ if (key == 'd' || key == 'D'){
int debug=0; int debug=0;
if(key == 'D') { if(key == 'D') {
debug = input_streams[0]->st->codec->debug<<1;
debug = input_streams[0]->dec_ctx->debug << 1;
if(!debug) debug = 1; if(!debug) debug = 1;
while(debug & (FF_DEBUG_DCT_COEFF while(debug & (FF_DEBUG_DCT_COEFF
#if FF_API_DEBUG_MV #if FF_API_DEBUG_MV
@@ -4034,7 +4026,7 @@ static int check_keyboard_interaction(int64_t cur_time)
fprintf(stderr,"error parsing debug value\n"); fprintf(stderr,"error parsing debug value\n");
} }
for(i=0;i<nb_input_streams;i++) { for(i=0;i<nb_input_streams;i++) {
input_streams[i]->st->codec->debug = debug;
input_streams[i]->dec_ctx->debug = debug;
} }
for(i=0;i<nb_output_streams;i++) { for(i=0;i<nb_output_streams;i++) {
OutputStream *ost = output_streams[i]; OutputStream *ost = output_streams[i];


Loading…
Cancel
Save