Commit 5bc2e536 authored by conrad's avatar conrad

oggdec: Move ogg_find_stream and ogg_gptopts to oggdec.h

(skeleton will need them)

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@22455 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 2ecb88f5
...@@ -145,18 +145,6 @@ ogg_find_codec (uint8_t * buf, int size) ...@@ -145,18 +145,6 @@ ogg_find_codec (uint8_t * buf, int size)
return NULL; return NULL;
} }
static int
ogg_find_stream (struct ogg * ogg, int serial)
{
int i;
for (i = 0; i < ogg->nstreams; i++)
if (ogg->streams[i].serial == serial)
return i;
return -1;
}
static int static int
ogg_new_stream (AVFormatContext * s, uint32_t serial) ogg_new_stream (AVFormatContext * s, uint32_t serial)
{ {
...@@ -440,25 +428,6 @@ ogg_get_headers (AVFormatContext * s) ...@@ -440,25 +428,6 @@ ogg_get_headers (AVFormatContext * s)
return 0; return 0;
} }
static uint64_t
ogg_gptopts (AVFormatContext * s, int i, uint64_t gp, int64_t *dts)
{
struct ogg *ogg = s->priv_data;
struct ogg_stream *os = ogg->streams + i;
uint64_t pts = AV_NOPTS_VALUE;
if(os->codec->gptopts){
pts = os->codec->gptopts(s, i, gp, dts);
} else {
pts = gp;
if (dts)
*dts = pts;
}
return pts;
}
static int static int
ogg_get_length (AVFormatContext * s) ogg_get_length (AVFormatContext * s)
{ {
......
...@@ -115,4 +115,34 @@ extern const AVMetadataConv ff_vorbiscomment_metadata_conv[]; ...@@ -115,4 +115,34 @@ extern const AVMetadataConv ff_vorbiscomment_metadata_conv[];
int vorbis_comment(AVFormatContext *ms, uint8_t *buf, int size); int vorbis_comment(AVFormatContext *ms, uint8_t *buf, int size);
static inline int
ogg_find_stream (struct ogg * ogg, int serial)
{
int i;
for (i = 0; i < ogg->nstreams; i++)
if (ogg->streams[i].serial == serial)
return i;
return -1;
}
static inline uint64_t
ogg_gptopts (AVFormatContext * s, int i, uint64_t gp, int64_t *dts)
{
struct ogg *ogg = s->priv_data;
struct ogg_stream *os = ogg->streams + i;
uint64_t pts = AV_NOPTS_VALUE;
if(os->codec->gptopts){
pts = os->codec->gptopts(s, i, gp, dts);
} else {
pts = gp;
if (dts)
*dts = pts;
}
return pts;
}
#endif /* AVFORMAT_OGGDEC_H */ #endif /* AVFORMAT_OGGDEC_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment