fftools/ffmpeg: Fix forward CPB props in to out

CPB side_data is copied when stream-copying (see init_output_stream_streamcopy()),
but it shall not be copied when the stream is decoded.

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
pull/331/head
Nicolas Gaullier 5 years ago committed by Michael Niedermayer
parent 26f4ee37f7
commit f40fb7963e
  1. 2
      fftools/ffmpeg.c

@ -3562,6 +3562,7 @@ static int init_output_stream(OutputStream *ost, char *error, int error_len)
int i; int i;
for (i = 0; i < ist->st->nb_side_data; i++) { for (i = 0; i < ist->st->nb_side_data; i++) {
AVPacketSideData *sd = &ist->st->side_data[i]; AVPacketSideData *sd = &ist->st->side_data[i];
if (sd->type != AV_PKT_DATA_CPB_PROPERTIES) {
uint8_t *dst = av_stream_new_side_data(ost->st, sd->type, sd->size); uint8_t *dst = av_stream_new_side_data(ost->st, sd->type, sd->size);
if (!dst) if (!dst)
return AVERROR(ENOMEM); return AVERROR(ENOMEM);
@ -3570,6 +3571,7 @@ static int init_output_stream(OutputStream *ost, char *error, int error_len)
av_display_rotation_set((uint32_t *)dst, 0); av_display_rotation_set((uint32_t *)dst, 0);
} }
} }
}
// copy timebase while removing common factors // copy timebase while removing common factors
if (ost->st->time_base.num <= 0 || ost->st->time_base.den <= 0) if (ost->st->time_base.num <= 0 || ost->st->time_base.den <= 0)

Loading…
Cancel
Save