[FFmpeg-cvslog] r24186 - trunk/libavcodec/dvbsubdec.c

reimar subversion
Sun Jul 11 09:45:42 CEST 2010


Author: reimar
Date: Sun Jul 11 09:45:42 2010
New Revision: 24186

Log:
Remove useless casts and memset.

Modified:
   trunk/libavcodec/dvbsubdec.c

Modified: trunk/libavcodec/dvbsubdec.c
==============================================================================
--- trunk/libavcodec/dvbsubdec.c	Sun Jul 11 09:35:00 2010	(r24185)
+++ trunk/libavcodec/dvbsubdec.c	Sun Jul 11 09:45:42 2010	(r24186)
@@ -356,9 +356,7 @@ static void delete_state(DVBSubContext *
 static av_cold int dvbsub_init_decoder(AVCodecContext *avctx)
 {
     int i, r, g, b, a = 0;
-    DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data;
-
-    memset(avctx->priv_data, 0, sizeof(DVBSubContext));
+    DVBSubContext *ctx = avctx->priv_data;
 
     ctx->composition_id = avctx->sub_id & 0xffff;
     ctx->ancillary_id = avctx->sub_id >> 16;
@@ -428,7 +426,7 @@ static av_cold int dvbsub_init_decoder(A
 
 static av_cold int dvbsub_close_decoder(AVCodecContext *avctx)
 {
-    DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data;
+    DVBSubContext *ctx = avctx->priv_data;
     DVBSubRegionDisplay *display;
 
     delete_state(ctx);
@@ -731,7 +729,7 @@ static int dvbsub_read_8bit_string(uint8
 static void dvbsub_parse_pixel_data_block(AVCodecContext *avctx, DVBSubObjectDisplay *display,
                                           const uint8_t *buf, int buf_size, int top_bottom, int non_mod)
 {
-    DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data;
+    DVBSubContext *ctx = avctx->priv_data;
 
     DVBSubRegion *region = get_region(ctx, display->region_id);
     const uint8_t *buf_end = buf + buf_size;
@@ -848,7 +846,7 @@ static void dvbsub_parse_pixel_data_bloc
 static void dvbsub_parse_object_segment(AVCodecContext *avctx,
                                         const uint8_t *buf, int buf_size)
 {
-    DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data;
+    DVBSubContext *ctx = avctx->priv_data;
 
     const uint8_t *buf_end = buf + buf_size;
     const uint8_t *block;
@@ -907,7 +905,7 @@ static void dvbsub_parse_object_segment(
 static void dvbsub_parse_clut_segment(AVCodecContext *avctx,
                                         const uint8_t *buf, int buf_size)
 {
-    DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data;
+    DVBSubContext *ctx = avctx->priv_data;
 
     const uint8_t *buf_end = buf + buf_size;
     int clut_id;
@@ -995,7 +993,7 @@ static void dvbsub_parse_clut_segment(AV
 static void dvbsub_parse_region_segment(AVCodecContext *avctx,
                                         const uint8_t *buf, int buf_size)
 {
-    DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data;
+    DVBSubContext *ctx = avctx->priv_data;
 
     const uint8_t *buf_end = buf + buf_size;
     int region_id, object_id;
@@ -1107,7 +1105,7 @@ static void dvbsub_parse_region_segment(
 static void dvbsub_parse_page_segment(AVCodecContext *avctx,
                                         const uint8_t *buf, int buf_size)
 {
-    DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data;
+    DVBSubContext *ctx = avctx->priv_data;
     DVBSubRegionDisplay *display;
     DVBSubRegionDisplay *tmp_display_list, **tmp_ptr;
 
@@ -1311,7 +1309,7 @@ static void dvbsub_parse_display_definit
 static int dvbsub_display_end_segment(AVCodecContext *avctx, const uint8_t *buf,
                                         int buf_size, AVSubtitle *sub)
 {
-    DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data;
+    DVBSubContext *ctx = avctx->priv_data;
     DVBSubDisplayDefinition *display_def = ctx->display_definition;
 
     DVBSubRegion *region;
@@ -1399,8 +1397,8 @@ static int dvbsub_decode(AVCodecContext 
 {
     const uint8_t *buf = avpkt->data;
     int buf_size = avpkt->size;
-    DVBSubContext *ctx = (DVBSubContext*) avctx->priv_data;
-    AVSubtitle *sub = (AVSubtitle*) data;
+    DVBSubContext *ctx = avctx->priv_data;
+    AVSubtitle *sub = data;
     const uint8_t *p, *p_end;
     int segment_type;
     int page_id;



More information about the ffmpeg-cvslog mailing list