Skip to content

Commit 0abee08

Browse files
fix warning forced frame type was changed message
fixes warning messages: warning messages (forced frame type (5) at 80 was changed to frame type (3))
1 parent d874dbc commit 0abee08

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

3_transcoding.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,11 @@ int prepare_audio_encoder(StreamingContext *sc, int sample_rate, StreamingParams
126126
sc->audio_avcc->sample_rate = sample_rate;
127127
sc->audio_avcc->sample_fmt = sc->audio_avc->sample_fmts[0];
128128
sc->audio_avcc->bit_rate = OUTPUT_BIT_RATE;
129+
sc->audio_avcc->time_base = (AVRational){1, sample_rate};
129130

130131
sc->audio_avcc->strict_std_compliance = FF_COMPLIANCE_EXPERIMENTAL;
131132

132-
sc->audio_avs->time_base.den = sample_rate;
133-
sc->audio_avs->time_base.num = 1;
133+
sc->audio_avs->time_base = sc->audio_avcc->time_base;
134134

135135
if (avcodec_open2(sc->audio_avcc, sc->audio_avc, NULL) < 0) {logging("could not open the codec"); return -1;}
136136
avcodec_parameters_from_context(sc->audio_avs->codecpar, sc->audio_avcc);
@@ -150,6 +150,8 @@ int remux(AVPacket **pkt, AVFormatContext **avfc, AVRational decoder_tb, AVRatio
150150
}
151151

152152
int encode_video(StreamingContext *decoder, StreamingContext *encoder, AVFrame *input_frame) {
153+
if (input_frame) input_frame->pict_type = AV_PICTURE_TYPE_NONE;
154+
153155
AVPacket *output_packet = av_packet_alloc();
154156
if (!output_packet) {logging("could not allocate memory for output packet"); return -1;}
155157

0 commit comments

Comments
 (0)