Mercurial > libavformat.hg
comparison oggdec.c @ 5810:d090202af37d libavformat
oggdec: Move ogg_find_stream and ogg_gptopts to oggdec.h
(skeleton will need them)
author | conrad |
---|---|
date | Thu, 11 Mar 2010 07:17:33 +0000 |
parents | 32f77ddb93fa |
children | c66b238d4d33 |
comparison
equal
deleted
inserted
replaced
5809:32f77ddb93fa | 5810:d090202af37d |
---|---|
141 if (size >= ogg_codecs[i]->magicsize && | 141 if (size >= ogg_codecs[i]->magicsize && |
142 !memcmp (buf, ogg_codecs[i]->magic, ogg_codecs[i]->magicsize)) | 142 !memcmp (buf, ogg_codecs[i]->magic, ogg_codecs[i]->magicsize)) |
143 return ogg_codecs[i]; | 143 return ogg_codecs[i]; |
144 | 144 |
145 return NULL; | 145 return NULL; |
146 } | |
147 | |
148 static int | |
149 ogg_find_stream (struct ogg * ogg, int serial) | |
150 { | |
151 int i; | |
152 | |
153 for (i = 0; i < ogg->nstreams; i++) | |
154 if (ogg->streams[i].serial == serial) | |
155 return i; | |
156 | |
157 return -1; | |
158 } | 146 } |
159 | 147 |
160 static int | 148 static int |
161 ogg_new_stream (AVFormatContext * s, uint32_t serial) | 149 ogg_new_stream (AVFormatContext * s, uint32_t serial) |
162 { | 150 { |
438 #endif | 426 #endif |
439 | 427 |
440 return 0; | 428 return 0; |
441 } | 429 } |
442 | 430 |
443 static uint64_t | |
444 ogg_gptopts (AVFormatContext * s, int i, uint64_t gp, int64_t *dts) | |
445 { | |
446 struct ogg *ogg = s->priv_data; | |
447 struct ogg_stream *os = ogg->streams + i; | |
448 uint64_t pts = AV_NOPTS_VALUE; | |
449 | |
450 if(os->codec->gptopts){ | |
451 pts = os->codec->gptopts(s, i, gp, dts); | |
452 } else { | |
453 pts = gp; | |
454 if (dts) | |
455 *dts = pts; | |
456 } | |
457 | |
458 return pts; | |
459 } | |
460 | |
461 | |
462 static int | 431 static int |
463 ogg_get_length (AVFormatContext * s) | 432 ogg_get_length (AVFormatContext * s) |
464 { | 433 { |
465 struct ogg *ogg = s->priv_data; | 434 struct ogg *ogg = s->priv_data; |
466 int idx = -1, i; | 435 int idx = -1, i; |