[FFmpeg-cvslog] avcodec/pgssubdec: split out flush_cache()
John Stebbins
git at videolan.org
Mon Jun 30 18:10:39 CEST 2014
ffmpeg | branch: master | John Stebbins <stebbins at jetheaddev.com> | Wed Jun 18 13:38:36 2014 -0700| [4701f7676ce9b2e9672960c12348b7de447419b2] | committer: Michael Niedermayer
avcodec/pgssubdec: split out flush_cache()
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4701f7676ce9b2e9672960c12348b7de447419b2
---
libavcodec/pgssubdec.c | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)
diff --git a/libavcodec/pgssubdec.c b/libavcodec/pgssubdec.c
index f572d81..63346c0 100644
--- a/libavcodec/pgssubdec.c
+++ b/libavcodec/pgssubdec.c
@@ -73,18 +73,10 @@ typedef struct PGSSubContext {
int forced_subs_only;
} PGSSubContext;
-static av_cold int init_decoder(AVCodecContext *avctx)
+static void flush_cache(AVCodecContext *avctx)
{
- avctx->pix_fmt = AV_PIX_FMT_PAL8;
-
- return 0;
-}
-
-static av_cold int close_decoder(AVCodecContext *avctx)
-{
- uint16_t picture;
-
PGSSubContext *ctx = avctx->priv_data;
+ uint16_t picture;
av_freep(&ctx->presentation.objects);
ctx->presentation.object_count = 0;
@@ -93,6 +85,18 @@ static av_cold int close_decoder(AVCodecContext *avctx)
av_freep(&ctx->pictures[picture].rle);
ctx->pictures[picture].rle_buffer_size = 0;
}
+}
+
+static av_cold int init_decoder(AVCodecContext *avctx)
+{
+ avctx->pix_fmt = AV_PIX_FMT_PAL8;
+
+ return 0;
+}
+
+static av_cold int close_decoder(AVCodecContext *avctx)
+{
+ flush_cache(avctx);
return 0;
}
More information about the ffmpeg-cvslog
mailing list