Re: [FFmpeg-devel] [PATCH v2 1/9] lavc/ccaption_dec: flush context on seek
On 13 January 2016 7:12:52 AM IST, Aman Guptawrote: >From: Aman Gupta > >--- > libavcodec/ccaption_dec.c | 21 + > 1 file changed, 21 insertions(+) > >diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c >index ca497e5..a9dfc94 100644 >--- a/libavcodec/ccaption_dec.c >+++ b/libavcodec/ccaption_dec.c >@@ -173,6 +173,26 @@ static av_cold int close_decoder(AVCodecContext >*avctx) > return 0; > } > >+static void flush_decoder(AVCodecContext *avctx) >+{ >+CCaptionSubContext *ctx = avctx->priv_data; >+ctx->screen[0].row_used = 0; >+ctx->screen[1].row_used = 0; >+ctx->prev_cmd[0] = 0; >+ctx->prev_cmd[1] = 0; >+ctx->mode = CCMODE_ROLLUP; >+ctx->rollup = 2; >+ctx->cursor_row = 0; >+ctx->cursor_column = 0; >+ctx->cursor_font = 0; >+ctx->cursor_color = 0; >+ctx->active_screen = 0; >+ctx->last_real_time = 0; >+ctx->screen_touched = 0; >+ctx->buffer_changed = 0; >+av_bprint_clear(>buffer); >+} >+ > /** > * @param ctx closed caption context just to print log > */ >@@ -578,6 +598,7 @@ AVCodec ff_ccaption_decoder = { > .priv_data_size = sizeof(CCaptionSubContext), > .init = init_decoder, > .close = close_decoder, >+.flush = flush_decoder, > .decode = decode, > .priv_class = _dec_class, > }; LGTM -Anshul -- Sent from my Android device with K-9 Mail. Please excuse my brevity. ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
[FFmpeg-devel] [PATCH v2 1/9] lavc/ccaption_dec: flush context on seek
From: Aman Gupta--- libavcodec/ccaption_dec.c | 21 + 1 file changed, 21 insertions(+) diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c index ca497e5..a9dfc94 100644 --- a/libavcodec/ccaption_dec.c +++ b/libavcodec/ccaption_dec.c @@ -173,6 +173,26 @@ static av_cold int close_decoder(AVCodecContext *avctx) return 0; } +static void flush_decoder(AVCodecContext *avctx) +{ +CCaptionSubContext *ctx = avctx->priv_data; +ctx->screen[0].row_used = 0; +ctx->screen[1].row_used = 0; +ctx->prev_cmd[0] = 0; +ctx->prev_cmd[1] = 0; +ctx->mode = CCMODE_ROLLUP; +ctx->rollup = 2; +ctx->cursor_row = 0; +ctx->cursor_column = 0; +ctx->cursor_font = 0; +ctx->cursor_color = 0; +ctx->active_screen = 0; +ctx->last_real_time = 0; +ctx->screen_touched = 0; +ctx->buffer_changed = 0; +av_bprint_clear(>buffer); +} + /** * @param ctx closed caption context just to print log */ @@ -578,6 +598,7 @@ AVCodec ff_ccaption_decoder = { .priv_data_size = sizeof(CCaptionSubContext), .init = init_decoder, .close = close_decoder, +.flush = flush_decoder, .decode = decode, .priv_class = _dec_class, }; -- 2.5.3 ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
Re: [FFmpeg-devel] [PATCH v2 1/9] lavc/ccaption_dec: flush context on seek
On Tue, Jan 12, 2016 at 5:42 PM, Aman Guptawrote: > From: Aman Gupta > > --- > libavcodec/ccaption_dec.c | 21 + > 1 file changed, 21 insertions(+) > > diff --git a/libavcodec/ccaption_dec.c b/libavcodec/ccaption_dec.c > index ca497e5..a9dfc94 100644 > --- a/libavcodec/ccaption_dec.c > +++ b/libavcodec/ccaption_dec.c > @@ -173,6 +173,26 @@ static av_cold int close_decoder(AVCodecContext > *avctx) > return 0; > } > > +static void flush_decoder(AVCodecContext *avctx) > +{ > +CCaptionSubContext *ctx = avctx->priv_data; > +ctx->screen[0].row_used = 0; > +ctx->screen[1].row_used = 0; > +ctx->prev_cmd[0] = 0; > +ctx->prev_cmd[1] = 0; > +ctx->mode = CCMODE_ROLLUP; > +ctx->rollup = 2; > +ctx->cursor_row = 0; > +ctx->cursor_column = 0; > +ctx->cursor_font = 0; > +ctx->cursor_color = 0; > +ctx->active_screen = 0; > +ctx->last_real_time = 0; > +ctx->screen_touched = 0; > I messed up a rebase here... these two fields weren't introduced until the next commit. I've re-rolled the patchset here with a fix: https://github.com/tmm1/ffmpeg/compare/master...upstream-cc.patch > +ctx->buffer_changed = 0; > +av_bprint_clear(>buffer); > +} > + > /** > * @param ctx closed caption context just to print log > */ > @@ -578,6 +598,7 @@ AVCodec ff_ccaption_decoder = { > .priv_data_size = sizeof(CCaptionSubContext), > .init = init_decoder, > .close = close_decoder, > +.flush = flush_decoder, > .decode = decode, > .priv_class = _dec_class, > }; > -- > 2.5.3 > > ___ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-devel