Mercurial > mplayer.hg
comparison libmpdemux/demux_ogg.c @ 25494:e88c0aa4bb96
Use realloc_struct in more places for consistency
author | reimar |
---|---|
date | Mon, 24 Dec 2007 16:05:09 +0000 |
parents | fabaf34bd545 |
children | 5cbf0cbeef7c |
comparison
equal
deleted
inserted
replaced
25493:fabaf34bd545 | 25494:e88c0aa4bb96 |
---|---|
805 mp_msg(MSGT_DEMUX,MSGL_ERR,"Ogg : Warning found none bos page from unknown stream %d\n",ogg_page_serialno(page)); | 805 mp_msg(MSGT_DEMUX,MSGL_ERR,"Ogg : Warning found none bos page from unknown stream %d\n",ogg_page_serialno(page)); |
806 break; | 806 break; |
807 } | 807 } |
808 | 808 |
809 /// Init the data structure needed for a logical stream | 809 /// Init the data structure needed for a logical stream |
810 ogg_d->subs = realloc(ogg_d->subs,(ogg_d->num_sub+1)*sizeof(ogg_stream_t)); | 810 ogg_d->subs = realloc_struct(ogg_d->subs,ogg_d->num_sub+1,sizeof(ogg_stream_t)); |
811 memset(&ogg_d->subs[ogg_d->num_sub],0,sizeof(ogg_stream_t)); | 811 memset(&ogg_d->subs[ogg_d->num_sub],0,sizeof(ogg_stream_t)); |
812 /// Get the stream serial number | 812 /// Get the stream serial number |
813 s_no = ogg_page_serialno(page); | 813 s_no = ogg_page_serialno(page); |
814 ogg_stream_init(&ogg_d->subs[ogg_d->num_sub].stream,s_no); | 814 ogg_stream_init(&ogg_d->subs[ogg_d->num_sub].stream,s_no); |
815 mp_msg(MSGT_DEMUX,MSGL_DBG2,"Ogg : Found a stream with serial=%d\n",s_no); | 815 mp_msg(MSGT_DEMUX,MSGL_DBG2,"Ogg : Found a stream with serial=%d\n",s_no); |
1044 ogg_d->subs[ogg_d->num_sub].id = ogg_d->n_text; | 1044 ogg_d->subs[ogg_d->num_sub].id = ogg_d->n_text; |
1045 if (demuxer->sub->id == ogg_d->n_text) | 1045 if (demuxer->sub->id == ogg_d->n_text) |
1046 text_id = ogg_d->num_sub; | 1046 text_id = ogg_d->num_sub; |
1047 new_sh_sub(demuxer, ogg_d->n_text); | 1047 new_sh_sub(demuxer, ogg_d->n_text); |
1048 ogg_d->n_text++; | 1048 ogg_d->n_text++; |
1049 ogg_d->text_ids = realloc(ogg_d->text_ids, sizeof(int) * ogg_d->n_text); | 1049 ogg_d->text_ids = realloc_struct(ogg_d->text_ids, ogg_d->n_text, sizeof(int)); |
1050 ogg_d->text_ids[ogg_d->n_text - 1] = ogg_d->num_sub; | 1050 ogg_d->text_ids[ogg_d->n_text - 1] = ogg_d->num_sub; |
1051 ogg_d->text_langs = realloc(ogg_d->text_langs, sizeof(char *) * ogg_d->n_text); | 1051 ogg_d->text_langs = realloc_struct(ogg_d->text_langs, ogg_d->n_text, sizeof(char *)); |
1052 ogg_d->text_langs[ogg_d->n_text - 1] = NULL; | 1052 ogg_d->text_langs[ogg_d->n_text - 1] = NULL; |
1053 //// Unknown header type | 1053 //// Unknown header type |
1054 } else | 1054 } else |
1055 mp_msg(MSGT_DEMUX,MSGL_ERR,"Ogg stream %d has a header marker but is of an unknown type\n",ogg_d->num_sub); | 1055 mp_msg(MSGT_DEMUX,MSGL_ERR,"Ogg stream %d has a header marker but is of an unknown type\n",ogg_d->num_sub); |
1056 /// Unknown (invalid ?) header | 1056 /// Unknown (invalid ?) header |