Skip to content

Commit

Permalink
lavf: make av_set_pts_info private.
Browse files Browse the repository at this point in the history
It's supposed to be called only from (de)muxers.
  • Loading branch information
elenril committed Nov 30, 2011
1 parent 06d7325 commit c3f9ebf
Show file tree
Hide file tree
Showing 139 changed files with 338 additions and 205 deletions.
3 changes: 2 additions & 1 deletion libavdevice/alsa-audio-dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@

#include <alsa/asoundlib.h>
#include "libavformat/avformat.h"
#include "libavformat/internal.h"
#include "libavutil/opt.h"

#include "alsa-audio.h"
Expand Down Expand Up @@ -102,7 +103,7 @@ static av_cold int audio_read_header(AVFormatContext *s1,
st->codec->codec_id = codec_id;
st->codec->sample_rate = s->sample_rate;
st->codec->channels = s->channels;
av_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */
avpriv_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */

return 0;

Expand Down
3 changes: 2 additions & 1 deletion libavdevice/bktr.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
*/

#include "libavformat/avformat.h"
#include "libavformat/internal.h"
#include "libavutil/log.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
Expand Down Expand Up @@ -275,7 +276,7 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
ret = AVERROR(ENOMEM);
goto out;
}
av_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in use */
avpriv_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in use */

s->width = width;
s->height = height;
Expand Down
3 changes: 2 additions & 1 deletion libavdevice/fbdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include "libavutil/parseutils.h"
#include "libavutil/pixdesc.h"
#include "libavformat/avformat.h"
#include "libavformat/internal.h"

struct rgb_pixfmt_map_entry {
int bits_per_pixel;
Expand Down Expand Up @@ -110,7 +111,7 @@ av_cold static int fbdev_read_header(AVFormatContext *avctx,

if (!(st = avformat_new_stream(avctx, NULL)))
return AVERROR(ENOMEM);
av_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in microseconds */
avpriv_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in microseconds */

/* NONBLOCK is ignored by the fbdev driver, only set for consistency */
if (avctx->flags & AVFMT_FLAG_NONBLOCK)
Expand Down
3 changes: 2 additions & 1 deletion libavdevice/jack_audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include "libavutil/opt.h"
#include "libavcodec/avcodec.h"
#include "libavformat/avformat.h"
#include "libavformat/internal.h"
#include "timefilter.h"

/**
Expand Down Expand Up @@ -244,7 +245,7 @@ static int audio_read_header(AVFormatContext *context, AVFormatParameters *param
stream->codec->sample_rate = self->sample_rate;
stream->codec->channels = self->nports;

av_set_pts_info(stream, 64, 1, 1000000); /* 64 bits pts in us */
avpriv_set_pts_info(stream, 64, 1, 1000000); /* 64 bits pts in us */
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion libavdevice/libcdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ static av_cold int read_header(AVFormatContext *ctx, AVFormatParameters *ap)
st->duration = s->drive->audio_last_sector - s->drive->audio_first_sector;
else if (s->drive->tracks)
st->duration = s->drive->disc_toc[s->drive->tracks].dwStartSector;
av_set_pts_info(st, 64, CDIO_CD_FRAMESIZE_RAW, 2*st->codec->channels*st->codec->sample_rate);
avpriv_set_pts_info(st, 64, CDIO_CD_FRAMESIZE_RAW, 2*st->codec->channels*st->codec->sample_rate);

for (i = 0; i < s->drive->tracks; i++) {
char title[16];
Expand Down
3 changes: 2 additions & 1 deletion libavdevice/libdc1394.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include "config.h"
#include "libavformat/avformat.h"
#include "libavformat/internal.h"
#include "libavutil/log.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
Expand Down Expand Up @@ -165,7 +166,7 @@ static inline int dc1394_read_common(AVFormatContext *c, AVFormatParameters *ap,
ret = AVERROR(ENOMEM);
goto out;
}
av_set_pts_info(vst, 64, 1, 1000);
avpriv_set_pts_info(vst, 64, 1, 1000);
vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
vst->codec->codec_id = CODEC_ID_RAWVIDEO;
vst->codec->time_base.den = framerate.num;
Expand Down
3 changes: 2 additions & 1 deletion libavdevice/oss_audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include "libavutil/opt.h"
#include "libavcodec/avcodec.h"
#include "libavformat/avformat.h"
#include "libavformat/internal.h"

#define AUDIO_BLOCK_SIZE 4096

Expand Down Expand Up @@ -225,7 +226,7 @@ static int audio_read_header(AVFormatContext *s1, AVFormatParameters *ap)
st->codec->sample_rate = s->sample_rate;
st->codec->channels = s->channels;

av_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */
avpriv_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */
return 0;
}

Expand Down
3 changes: 2 additions & 1 deletion libavdevice/pulse.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include <pulse/error.h>

#include "libavformat/avformat.h"
#include "libavformat/internal.h"
#include "libavutil/opt.h"

#define DEFAULT_CODEC_ID AV_NE(CODEC_ID_PCM_S16BE, CODEC_ID_PCM_S16LE)
Expand Down Expand Up @@ -108,7 +109,7 @@ static av_cold int pulse_read_header(AVFormatContext *s,
st->codec->codec_id = codec_id;
st->codec->sample_rate = pd->sample_rate;
st->codec->channels = pd->channels;
av_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */
avpriv_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */

pd->pts = AV_NOPTS_VALUE;
pd->frame_duration = (pd->frame_size * 1000000LL * 8) /
Expand Down
3 changes: 2 additions & 1 deletion libavdevice/sndio_dec.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <sndio.h>

#include "libavformat/avformat.h"
#include "libavformat/internal.h"
#include "libavutil/opt.h"

#include "sndio_common.h"
Expand All @@ -48,7 +49,7 @@ static av_cold int audio_read_header(AVFormatContext *s1,
st->codec->sample_rate = s->sample_rate;
st->codec->channels = s->channels;

av_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */
avpriv_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */

return 0;
}
Expand Down
3 changes: 2 additions & 1 deletion libavdevice/v4l.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "libavutil/log.h"
#include "libavutil/opt.h"
#include "libavformat/avformat.h"
#include "libavformat/internal.h"
#include "libavcodec/dsputil.h"
#include <unistd.h>
#include <fcntl.h>
Expand Down Expand Up @@ -100,7 +101,7 @@ static int grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
st = avformat_new_stream(s1, NULL);
if (!st)
return AVERROR(ENOMEM);
av_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */
avpriv_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */

video_fd = open(s1->filename, O_RDWR);
if (video_fd < 0) {
Expand Down
3 changes: 2 additions & 1 deletion libavdevice/v4l2.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#undef __STRICT_ANSI__ //workaround due to broken kernel headers
#include "config.h"
#include "libavformat/avformat.h"
#include "libavformat/internal.h"
#include <unistd.h>
#include <fcntl.h>
#include <sys/ioctl.h>
Expand Down Expand Up @@ -585,7 +586,7 @@ static int v4l2_read_header(AVFormatContext *s1, AVFormatParameters *ap)
res = AVERROR(ENOMEM);
goto out;
}
av_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */
avpriv_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */

if (s->video_size && (res = av_parse_video_size(&s->width, &s->height, s->video_size)) < 0) {
av_log(s1, AV_LOG_ERROR, "Could not parse video size '%s'.\n", s->video_size);
Expand Down
3 changes: 2 additions & 1 deletion libavdevice/vfwcap.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*/

#include "libavformat/avformat.h"
#include "libavformat/internal.h"
#include "libavutil/log.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
Expand Down Expand Up @@ -396,7 +397,7 @@ static int vfw_read_header(AVFormatContext *s, AVFormatParameters *ap)
}
}

av_set_pts_info(st, 32, 1, 1000);
avpriv_set_pts_info(st, 32, 1, 1000);

ctx->mutex = CreateMutex(NULL, 0, NULL);
if(!ctx->mutex) {
Expand Down
3 changes: 2 additions & 1 deletion libavdevice/x11grab.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@

#include "config.h"
#include "libavformat/avformat.h"
#include "libavformat/internal.h"
#include "libavutil/log.h"
#include "libavutil/opt.h"
#include "libavutil/parseutils.h"
Expand Down Expand Up @@ -198,7 +199,7 @@ x11grab_read_header(AVFormatContext *s1, AVFormatParameters *ap)
ret = AVERROR(ENOMEM);
goto out;
}
av_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */
avpriv_set_pts_info(st, 64, 1, 1000000); /* 64 bits pts in us */

screen = DefaultScreen(dpy);

Expand Down
5 changes: 3 additions & 2 deletions libavformat/4xm.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "libavutil/intreadwrite.h"
#include "libavutil/intfloat_readwrite.h"
#include "avformat.h"
#include "internal.h"

#define RIFF_TAG MKTAG('R', 'I', 'F', 'F')
#define FOURXMV_TAG MKTAG('4', 'X', 'M', 'V')
Expand Down Expand Up @@ -146,7 +147,7 @@ static int fourxm_read_header(AVFormatContext *s,
ret= AVERROR(ENOMEM);
goto fail;
}
av_set_pts_info(st, 60, 1, fourxm->fps);
avpriv_set_pts_info(st, 60, 1, fourxm->fps);

fourxm->video_stream_index = st->index;

Expand Down Expand Up @@ -205,7 +206,7 @@ static int fourxm_read_header(AVFormatContext *s,
}

st->id = current_track;
av_set_pts_info(st, 60, 1, fourxm->tracks[current_track].sample_rate);
avpriv_set_pts_info(st, 60, 1, fourxm->tracks[current_track].sample_rate);

fourxm->tracks[current_track].stream_index = st->index;

Expand Down
3 changes: 2 additions & 1 deletion libavformat/aacdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
#include "rawdec.h"
#include "id3v1.h"

Expand Down Expand Up @@ -76,7 +77,7 @@ static int adts_aac_read_header(AVFormatContext *s,
ff_id3v1_read(s);

//LCM of all possible ADTS sample rates
av_set_pts_info(st, 64, 1, 28224000);
avpriv_set_pts_info(st, 64, 1, 28224000);

return 0;
}
Expand Down
3 changes: 2 additions & 1 deletion libavformat/adxdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "libavutil/intreadwrite.h"
#include "libavcodec/adx.h"
#include "avformat.h"
#include "internal.h"

#define BLOCK_SIZE 18
#define BLOCK_SAMPLES 32
Expand Down Expand Up @@ -95,7 +96,7 @@ static int adx_read_header(AVFormatContext *s, AVFormatParameters *ap)
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
st->codec->codec_id = s->iformat->value;

av_set_pts_info(st, 64, BLOCK_SAMPLES, avctx->sample_rate);
avpriv_set_pts_info(st, 64, BLOCK_SAMPLES, avctx->sample_rate);

return 0;
}
Expand Down
3 changes: 2 additions & 1 deletion libavformat/aiffdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include "libavutil/intfloat_readwrite.h"
#include "libavutil/dict.h"
#include "avformat.h"
#include "internal.h"
#include "pcm.h"
#include "aiff.h"

Expand Down Expand Up @@ -268,7 +269,7 @@ static int aiff_read_header(AVFormatContext *s,

got_sound:
/* Now positioned, get the sound data start and end */
av_set_pts_info(st, 64, 1, st->codec->sample_rate);
avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
st->start_time = 0;
st->duration = st->codec->frame_size ?
st->nb_frames * st->codec->frame_size : st->nb_frames;
Expand Down
3 changes: 2 additions & 1 deletion libavformat/aiffenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#include "libavutil/intfloat_readwrite.h"
#include "avformat.h"
#include "internal.h"
#include "aiff.h"
#include "avio_internal.h"

Expand Down Expand Up @@ -96,7 +97,7 @@ static int aiff_write_header(AVFormatContext *s)
avio_wb32(pb, 0); /* Data offset */
avio_wb32(pb, 0); /* Block-size (block align) */

av_set_pts_info(s->streams[0], 64, 1, s->streams[0]->codec->sample_rate);
avpriv_set_pts_info(s->streams[0], 64, 1, s->streams[0]->codec->sample_rate);

/* Data is starting here */
avio_flush(pb);
Expand Down
3 changes: 2 additions & 1 deletion libavformat/amr.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Only mono files are supported.
*/
#include "avformat.h"
#include "internal.h"

static const char AMR_header [] = "#!AMR\n";
static const char AMRWB_header [] = "#!AMR-WB\n";
Expand Down Expand Up @@ -111,7 +112,7 @@ static int amr_read_header(AVFormatContext *s,
}
st->codec->channels = 1;
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
av_set_pts_info(st, 64, 1, st->codec->sample_rate);
avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);

return 0;
}
Expand Down
3 changes: 2 additions & 1 deletion libavformat/anm.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"

typedef struct {
int base_record;
Expand Down Expand Up @@ -128,7 +129,7 @@ static int read_header(AVFormatContext *s,

avio_skip(pb, 32); /* record_types */
st->nb_frames = avio_rl32(pb);
av_set_pts_info(st, 64, 1, avio_rl16(pb));
avpriv_set_pts_info(st, 64, 1, avio_rl16(pb));
avio_skip(pb, 58);

/* color cycling and palette data */
Expand Down
3 changes: 2 additions & 1 deletion libavformat/ape.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include "libavutil/intreadwrite.h"
#include "avformat.h"
#include "internal.h"
#include "apetag.h"

/* The earliest and latest file formats supported by this library */
Expand Down Expand Up @@ -330,7 +331,7 @@ static int ape_read_header(AVFormatContext * s, AVFormatParameters * ap)
st->nb_frames = ape->totalframes;
st->start_time = 0;
st->duration = total_blocks / MAC_SUBFRAME_SIZE;
av_set_pts_info(st, 64, MAC_SUBFRAME_SIZE, ape->samplerate);
avpriv_set_pts_info(st, 64, MAC_SUBFRAME_SIZE, ape->samplerate);

st->codec->extradata = av_malloc(APE_EXTRADATA_SIZE);
st->codec->extradata_size = APE_EXTRADATA_SIZE;
Expand Down
3 changes: 2 additions & 1 deletion libavformat/asfdec.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "libavutil/mathematics.h"
#include "libavcodec/mpegaudio.h"
#include "avformat.h"
#include "internal.h"
#include "avio_internal.h"
#include "riff.h"
#include "asf.h"
Expand Down Expand Up @@ -230,7 +231,7 @@ static int asf_read_stream_properties(AVFormatContext *s, int64_t size)
st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
av_set_pts_info(st, 32, 1, 1000); /* 32 bit pts in ms */
avpriv_set_pts_info(st, 32, 1, 1000); /* 32 bit pts in ms */
asf_st = av_mallocz(sizeof(ASFStream));
if (!asf_st)
return AVERROR(ENOMEM);
Expand Down
3 changes: 2 additions & 1 deletion libavformat/asfenc.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "avformat.h"
#include "internal.h"
#include "riff.h"
#include "asf.h"
#include "avio_internal.h"
Expand Down Expand Up @@ -321,7 +322,7 @@ static int asf_write_header1(AVFormatContext *s, int64_t file_size, int64_t data
for(n=0;n<s->nb_streams;n++) {
enc = s->streams[n]->codec;

av_set_pts_info(s->streams[n], 32, 1, 1000); /* 32 bit pts in ms */
avpriv_set_pts_info(s->streams[n], 32, 1, 1000); /* 32 bit pts in ms */

bit_rate += enc->bit_rate;
}
Expand Down
Loading

0 comments on commit c3f9ebf

Please sign in to comment.