Mercurial > libavcodec.hg
comparison mpegvideo_parser.c @ 4931:0d1cc37d9430 libavcodec
make some parser parameters const to avoid casting const to non-const
| author | aurel |
|---|---|
| date | Mon, 07 May 2007 00:47:03 +0000 |
| parents | 13ef168891b0 |
| children | 9f4f88218b78 |
comparison
equal
deleted
inserted
replaced
| 4930:655d25351bfc | 4931:0d1cc37d9430 |
|---|---|
| 126 the_end: ; | 126 the_end: ; |
| 127 } | 127 } |
| 128 | 128 |
| 129 static int mpegvideo_parse(AVCodecParserContext *s, | 129 static int mpegvideo_parse(AVCodecParserContext *s, |
| 130 AVCodecContext *avctx, | 130 AVCodecContext *avctx, |
| 131 uint8_t **poutbuf, int *poutbuf_size, | 131 const uint8_t **poutbuf, int *poutbuf_size, |
| 132 const uint8_t *buf, int buf_size) | 132 const uint8_t *buf, int buf_size) |
| 133 { | 133 { |
| 134 ParseContext1 *pc1 = s->priv_data; | 134 ParseContext1 *pc1 = s->priv_data; |
| 135 ParseContext *pc= &pc1->pc; | 135 ParseContext *pc= &pc1->pc; |
| 136 int next; | 136 int next; |
| 138 if(s->flags & PARSER_FLAG_COMPLETE_FRAMES){ | 138 if(s->flags & PARSER_FLAG_COMPLETE_FRAMES){ |
| 139 next= buf_size; | 139 next= buf_size; |
| 140 }else{ | 140 }else{ |
| 141 next= ff_mpeg1_find_frame_end(pc, buf, buf_size); | 141 next= ff_mpeg1_find_frame_end(pc, buf, buf_size); |
| 142 | 142 |
| 143 if (ff_combine_frame(pc, next, (uint8_t **)&buf, &buf_size) < 0) { | 143 if (ff_combine_frame(pc, next, &buf, &buf_size) < 0) { |
| 144 *poutbuf = NULL; | 144 *poutbuf = NULL; |
| 145 *poutbuf_size = 0; | 145 *poutbuf_size = 0; |
| 146 return buf_size; | 146 return buf_size; |
| 147 } | 147 } |
| 148 | 148 |
| 154 #if 0 | 154 #if 0 |
| 155 printf("pict_type=%d frame_rate=%0.3f repeat_pict=%d\n", | 155 printf("pict_type=%d frame_rate=%0.3f repeat_pict=%d\n", |
| 156 s->pict_type, (double)avctx->time_base.den / avctx->time_base.num, s->repeat_pict); | 156 s->pict_type, (double)avctx->time_base.den / avctx->time_base.num, s->repeat_pict); |
| 157 #endif | 157 #endif |
| 158 | 158 |
| 159 *poutbuf = (uint8_t *)buf; | 159 *poutbuf = buf; |
| 160 *poutbuf_size = buf_size; | 160 *poutbuf_size = buf_size; |
| 161 return next; | 161 return next; |
| 162 } | 162 } |
| 163 | 163 |
| 164 static int mpegvideo_split(AVCodecContext *avctx, | 164 static int mpegvideo_split(AVCodecContext *avctx, |
