On Mon, Sep 01, 2014 at 04:53:00PM +0200, Nicolas George wrote: > Le quintidi 15 fructidor, an CCXXII, Michael Niedermayer a écrit : > > Fixes/works around Ticket3768 > > > > Signed-off-by: Michael Niedermayer <michae...@gmx.at> > > --- > > ffmpeg.c | 5 +++-- > > ffmpeg.h | 5 ++++- > > ffmpeg_filter.c | 2 +- > > 3 files changed, 8 insertions(+), 4 deletions(-) > > > > diff --git a/ffmpeg.c b/ffmpeg.c > > index 8bca9e7..d5b53e7 100644 > > --- a/ffmpeg.c > > +++ b/ffmpeg.c > > @@ -2297,7 +2297,8 @@ static int init_input_stream(int ist_index, char > > *error, int error_len) > > ist->dec_ctx->thread_safe_callbacks = 1; > > > > av_opt_set_int(ist->dec_ctx, "refcounted_frames", 1, 0); > > - if(ist->dec_ctx->codec_id == AV_CODEC_ID_DVB_SUBTITLE) > > + if (ist->dec_ctx->codec_id == AV_CODEC_ID_DVB_SUBTITLE && > > + (ist->decoding_needed & DECODING_FOR_OST)) > > av_dict_set(&ist->decoder_opts, "compute_edt", "1", > > AV_DICT_DONT_OVERWRITE); > > > > if (!av_dict_get(ist->decoder_opts, "threads", NULL, 0)) > > @@ -2678,7 +2679,7 @@ static int transcode_init(void) > > } > > > > if (ist) > > - ist->decoding_needed++; > > + ist->decoding_needed |= DECODING_FOR_OST; > > ost->encoding_needed = 1; > > > > set_encoder_id(output_files[ost->file_index], ost); > > diff --git a/ffmpeg.h b/ffmpeg.h > > index 6545286..56eb66a 100644 > > --- a/ffmpeg.h > > +++ b/ffmpeg.h > > @@ -243,7 +243,10 @@ typedef struct InputStream { > > AVStream *st; > > int discard; /* true if stream data should be discarded */ > > int user_set_discard; > > - int decoding_needed; /* true if the packets must be decoded in > > 'raw_fifo' */ > > + int decoding_needed; /* non zero if the packets must be decoded in > > 'raw_fifo', see DECODING_FOR_* */ > > +#define DECODING_FOR_OST 1 > > +#define DECODING_FOR_FILTER 2 > > + > > AVCodecContext *dec_ctx; > > AVCodec *dec; > > AVFrame *decoded_frame; > > diff --git a/ffmpeg_filter.c b/ffmpeg_filter.c > > index 7acff28..93af8ce 100644 > > --- a/ffmpeg_filter.c > > +++ b/ffmpeg_filter.c > > @@ -275,7 +275,7 @@ static void init_input_filter(FilterGraph *fg, > > AVFilterInOut *in) > > av_assert0(ist); > > > > ist->discard = 0; > > - ist->decoding_needed++; > > + ist->decoding_needed |= DECODING_FOR_FILTER; > > ist->st->discard = AVDISCARD_NONE; > > > > GROW_ARRAY(fg->inputs, fg->nb_inputs); > > It seems like a good idea for now. Maybe print a warning if > ist->decoding_needed contains both flags, since there will be a problem both > ways.
warning added applied thanks [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Asymptotically faster algorithms should always be preferred if you have asymptotical amounts of data
signature.asc
Description: Digital signature
_______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel