mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-23 11:19:55 +00:00
lavf: make av_set_pts_info private.
It's supposed to be called only from (de)muxers.
This commit is contained in:
parent
06d7325ab1
commit
c3f9ebf743
@ -47,6 +47,7 @@
|
||||
|
||||
#include <alsa/asoundlib.h>
|
||||
#include "libavformat/avformat.h"
|
||||
#include "libavformat/internal.h"
|
||||
#include "libavutil/opt.h"
|
||||
|
||||
#include "alsa-audio.h"
|
||||
@ -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;
|
||||
|
||||
|
@ -25,6 +25,7 @@
|
||||
*/
|
||||
|
||||
#include "libavformat/avformat.h"
|
||||
#include "libavformat/internal.h"
|
||||
#include "libavutil/log.h"
|
||||
#include "libavutil/opt.h"
|
||||
#include "libavutil/parseutils.h"
|
||||
@ -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;
|
||||
|
@ -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;
|
||||
@ -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)
|
||||
|
@ -29,6 +29,7 @@
|
||||
#include "libavutil/opt.h"
|
||||
#include "libavcodec/avcodec.h"
|
||||
#include "libavformat/avformat.h"
|
||||
#include "libavformat/internal.h"
|
||||
#include "timefilter.h"
|
||||
|
||||
/**
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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];
|
||||
|
@ -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"
|
||||
@ -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;
|
||||
|
@ -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
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
@ -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) /
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include <sndio.h>
|
||||
|
||||
#include "libavformat/avformat.h"
|
||||
#include "libavformat/internal.h"
|
||||
#include "libavutil/opt.h"
|
||||
|
||||
#include "sndio_common.h"
|
||||
@ -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;
|
||||
}
|
||||
|
@ -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>
|
||||
@ -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) {
|
||||
|
@ -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>
|
||||
@ -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);
|
||||
|
@ -20,6 +20,7 @@
|
||||
*/
|
||||
|
||||
#include "libavformat/avformat.h"
|
||||
#include "libavformat/internal.h"
|
||||
#include "libavutil/log.h"
|
||||
#include "libavutil/opt.h"
|
||||
#include "libavutil/parseutils.h"
|
||||
@ -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) {
|
||||
|
@ -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"
|
||||
@ -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);
|
||||
|
||||
|
@ -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')
|
||||
@ -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;
|
||||
|
||||
@ -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;
|
||||
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "rawdec.h"
|
||||
#include "id3v1.h"
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
@ -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;
|
||||
}
|
||||
|
@ -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"
|
||||
|
||||
@ -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;
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
#include "libavutil/intfloat_readwrite.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "aiff.h"
|
||||
#include "avio_internal.h"
|
||||
|
||||
@ -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);
|
||||
|
@ -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";
|
||||
@ -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;
|
||||
}
|
||||
|
@ -26,6 +26,7 @@
|
||||
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
|
||||
typedef struct {
|
||||
int base_record;
|
||||
@ -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 */
|
||||
|
@ -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 */
|
||||
@ -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;
|
||||
|
@ -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"
|
||||
@ -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);
|
||||
|
@ -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"
|
||||
@ -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;
|
||||
}
|
||||
|
@ -86,7 +86,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
|
||||
st = avformat_new_stream(s, NULL);
|
||||
if (!st)
|
||||
return -1;
|
||||
av_set_pts_info(st, 64, 1, 100);
|
||||
avpriv_set_pts_info(st, 64, 1, 100);
|
||||
st->codec->codec_type = AVMEDIA_TYPE_SUBTITLE;
|
||||
st->codec->codec_id= CODEC_ID_SSA;
|
||||
|
||||
|
@ -28,6 +28,7 @@
|
||||
*/
|
||||
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "avio_internal.h"
|
||||
#include "pcm.h"
|
||||
#include "riff.h"
|
||||
@ -159,7 +160,7 @@ static int au_read_header(AVFormatContext *s,
|
||||
st->codec->codec_id = codec;
|
||||
st->codec->channels = channels;
|
||||
st->codec->sample_rate = rate;
|
||||
av_set_pts_info(st, 64, 1, rate);
|
||||
avpriv_set_pts_info(st, 64, 1, rate);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1540,18 +1540,14 @@ AVStream *avformat_new_stream(AVFormatContext *s, AVCodec *c);
|
||||
|
||||
AVProgram *av_new_program(AVFormatContext *s, int id);
|
||||
|
||||
#if FF_API_SET_PTS_INFO
|
||||
/**
|
||||
* Set the pts for a given stream. If the new values would be invalid
|
||||
* (<= 0), it leaves the AVStream unchanged.
|
||||
*
|
||||
* @param s stream
|
||||
* @param pts_wrap_bits number of bits effectively used by the pts
|
||||
* (used for wrap control, 33 is the value for MPEG)
|
||||
* @param pts_num numerator to convert to seconds (MPEG: 1)
|
||||
* @param pts_den denominator to convert to seconds (MPEG: 90000)
|
||||
* @deprecated this function is not supposed to be called outside of lavf
|
||||
*/
|
||||
attribute_deprecated
|
||||
void av_set_pts_info(AVStream *s, int pts_wrap_bits,
|
||||
unsigned int pts_num, unsigned int pts_den);
|
||||
#endif
|
||||
|
||||
#define AVSEEK_FLAG_BACKWARD 1 ///< seek backward
|
||||
#define AVSEEK_FLAG_BYTE 2 ///< seeking based on position in bytes
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "libavutil/dict.h"
|
||||
#include "libavutil/avstring.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "avi.h"
|
||||
#include "dv.h"
|
||||
#include "riff.h"
|
||||
@ -502,7 +503,7 @@ static int avi_read_header(AVFormatContext *s, AVFormatParameters *ap)
|
||||
ast->scale = 1;
|
||||
}
|
||||
}
|
||||
av_set_pts_info(st, 64, ast->scale, ast->rate);
|
||||
avpriv_set_pts_info(st, 64, ast->scale, ast->rate);
|
||||
|
||||
ast->cum_len=avio_rl32(pb); /* start */
|
||||
st->nb_frames = avio_rl32(pb);
|
||||
@ -784,7 +785,7 @@ static int read_gab2_sub(AVStream *st, AVPacket *pkt) {
|
||||
*st->codec = *ast->sub_ctx->streams[0]->codec;
|
||||
ast->sub_ctx->streams[0]->codec->extradata = NULL;
|
||||
time_base = ast->sub_ctx->streams[0]->time_base;
|
||||
av_set_pts_info(st, 64, time_base.num, time_base.den);
|
||||
avpriv_set_pts_info(st, 64, time_base.num, time_base.den);
|
||||
}
|
||||
ast->sub_buffer = pkt->data;
|
||||
memset(pkt, 0, sizeof(*pkt));
|
||||
|
@ -19,6 +19,7 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "avi.h"
|
||||
#include "avio_internal.h"
|
||||
#include "riff.h"
|
||||
@ -256,7 +257,7 @@ static int avi_write_header(AVFormatContext *s)
|
||||
|
||||
avio_wl32(pb, au_scale); /* scale */
|
||||
avio_wl32(pb, au_byterate); /* rate */
|
||||
av_set_pts_info(s->streams[i], 64, au_scale, au_byterate);
|
||||
avpriv_set_pts_info(s->streams[i], 64, au_scale, au_byterate);
|
||||
|
||||
avio_wl32(pb, 0); /* start */
|
||||
avist->frames_hdr_strm = avio_tell(pb); /* remember this offset to fill later */
|
||||
|
@ -20,6 +20,7 @@
|
||||
*/
|
||||
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "riff.h"
|
||||
|
||||
#include <windows.h>
|
||||
@ -137,7 +138,7 @@ static int avisynth_read_header(AVFormatContext *s, AVFormatParameters *ap)
|
||||
|
||||
st->codec->stream_codec_tag = stream->info.fccHandler;
|
||||
|
||||
av_set_pts_info(st, 64, info.dwScale, info.dwRate);
|
||||
avpriv_set_pts_info(st, 64, info.dwScale, info.dwRate);
|
||||
st->start_time = stream->info.dwStart;
|
||||
}
|
||||
}
|
||||
|
@ -29,6 +29,7 @@
|
||||
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "libavcodec/bethsoftvideo.h"
|
||||
|
||||
typedef struct BVID_DemuxContext
|
||||
@ -73,7 +74,7 @@ static int vid_read_header(AVFormatContext *s,
|
||||
stream = avformat_new_stream(s, NULL);
|
||||
if (!stream)
|
||||
return AVERROR(ENOMEM);
|
||||
av_set_pts_info(stream, 32, 1, 60); // 16 ms increments, i.e. 60 fps
|
||||
avpriv_set_pts_info(stream, 32, 1, 60); // 16 ms increments, i.e. 60 fps
|
||||
stream->codec->codec_type = AVMEDIA_TYPE_VIDEO;
|
||||
stream->codec->codec_id = CODEC_ID_BETHSOFTVID;
|
||||
stream->codec->width = avio_rl16(pb);
|
||||
|
@ -28,6 +28,7 @@
|
||||
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
|
||||
typedef struct BFIContext {
|
||||
int nframes;
|
||||
@ -86,7 +87,7 @@ static int bfi_read_header(AVFormatContext * s, AVFormatParameters * ap)
|
||||
astream->codec->sample_rate = avio_rl32(pb);
|
||||
|
||||
/* Set up the video codec... */
|
||||
av_set_pts_info(vstream, 32, 1, fps);
|
||||
avpriv_set_pts_info(vstream, 32, 1, fps);
|
||||
vstream->codec->codec_type = AVMEDIA_TYPE_VIDEO;
|
||||
vstream->codec->codec_id = CODEC_ID_BFI;
|
||||
vstream->codec->pix_fmt = PIX_FMT_PAL8;
|
||||
@ -99,7 +100,7 @@ static int bfi_read_header(AVFormatContext * s, AVFormatParameters * ap)
|
||||
astream->codec->bit_rate =
|
||||
astream->codec->sample_rate * astream->codec->bits_per_coded_sample;
|
||||
avio_seek(pb, chunk_header - 3, SEEK_SET);
|
||||
av_set_pts_info(astream, 64, 1, astream->codec->sample_rate);
|
||||
avpriv_set_pts_info(astream, 64, 1, astream->codec->sample_rate);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -30,6 +30,7 @@
|
||||
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
|
||||
enum BinkAudFlags {
|
||||
BINK_AUD_16BITS = 0x4000, ///< prefer 16-bit output
|
||||
@ -109,7 +110,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
|
||||
av_log(s, AV_LOG_ERROR, "invalid header: invalid fps (%d/%d)\n", fps_num, fps_den);
|
||||
return AVERROR(EIO);
|
||||
}
|
||||
av_set_pts_info(vst, 64, fps_den, fps_num);
|
||||
avpriv_set_pts_info(vst, 64, fps_den, fps_num);
|
||||
|
||||
vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
|
||||
vst->codec->codec_id = CODEC_ID_BINKVIDEO;
|
||||
@ -136,7 +137,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
|
||||
ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;
|
||||
ast->codec->codec_tag = 0;
|
||||
ast->codec->sample_rate = avio_rl16(pb);
|
||||
av_set_pts_info(ast, 64, 1, ast->codec->sample_rate);
|
||||
avpriv_set_pts_info(ast, 64, 1, ast->codec->sample_rate);
|
||||
flags = avio_rl16(pb);
|
||||
ast->codec->codec_id = flags & BINK_AUD_USEDCT ?
|
||||
CODEC_ID_BINKAUDIO_DCT : CODEC_ID_BINKAUDIO_RDFT;
|
||||
|
@ -20,6 +20,7 @@
|
||||
*/
|
||||
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
|
||||
enum BMVFlags {
|
||||
BMV_NOP = 0,
|
||||
@ -50,7 +51,7 @@ static int bmv_read_header(AVFormatContext *s, AVFormatParameters *ap)
|
||||
st->codec->width = 640;
|
||||
st->codec->height = 429;
|
||||
st->codec->pix_fmt = PIX_FMT_PAL8;
|
||||
av_set_pts_info(st, 16, 1, 12);
|
||||
avpriv_set_pts_info(st, 16, 1, 12);
|
||||
ast = avformat_new_stream(s, 0);
|
||||
if (!ast)
|
||||
return AVERROR(ENOMEM);
|
||||
@ -58,7 +59,7 @@ static int bmv_read_header(AVFormatContext *s, AVFormatParameters *ap)
|
||||
ast->codec->codec_id = CODEC_ID_BMV_AUDIO;
|
||||
ast->codec->channels = 2;
|
||||
ast->codec->sample_rate = 22050;
|
||||
av_set_pts_info(ast, 16, 1, 22050);
|
||||
avpriv_set_pts_info(ast, 16, 1, 22050);
|
||||
|
||||
c->get_next = 1;
|
||||
c->audio_pos = 0;
|
||||
|
@ -20,6 +20,7 @@
|
||||
*/
|
||||
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "voc.h"
|
||||
#include "libavutil/intreadwrite.h"
|
||||
|
||||
@ -89,7 +90,7 @@ static int read_header(AVFormatContext *s,
|
||||
video->codec->height = 192;
|
||||
/* 4:3 320x200 with 8 empty lines */
|
||||
video->sample_aspect_ratio = (AVRational) { 5, 6 };
|
||||
av_set_pts_info(video, 64, 2, 25);
|
||||
avpriv_set_pts_info(video, 64, 2, 25);
|
||||
video->nb_frames = framecount;
|
||||
video->duration = framecount;
|
||||
video->start_time = 0;
|
||||
|
@ -26,6 +26,7 @@
|
||||
*/
|
||||
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "riff.h"
|
||||
#include "isom.h"
|
||||
#include "libavutil/intreadwrite.h"
|
||||
@ -287,7 +288,7 @@ static int read_header(AVFormatContext *s,
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||
/* position the stream at the start of data */
|
||||
|
@ -20,6 +20,7 @@
|
||||
*/
|
||||
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
|
||||
#define CDG_PACKET_SIZE 24
|
||||
#define CDG_COMMAND 0x09
|
||||
@ -38,7 +39,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
|
||||
vst->codec->codec_id = CODEC_ID_CDGRAPHICS;
|
||||
|
||||
/// 75 sectors/sec * 4 packets/sector = 300 packets/sec
|
||||
av_set_pts_info(vst, 32, 1, 300);
|
||||
avpriv_set_pts_info(vst, 32, 1, 300);
|
||||
|
||||
ret = avio_size(s->pb);
|
||||
if (ret > 0)
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
|
||||
static int dfa_probe(AVProbeData *p)
|
||||
{
|
||||
@ -58,7 +59,7 @@ static int dfa_read_header(AVFormatContext *s,
|
||||
av_log(s, AV_LOG_WARNING, "Zero FPS reported, defaulting to 10\n");
|
||||
mspf = 100;
|
||||
}
|
||||
av_set_pts_info(st, 24, mspf, 1000);
|
||||
avpriv_set_pts_info(st, 24, mspf, 1000);
|
||||
avio_skip(pb, 128 - 16); // padding
|
||||
st->duration = frames;
|
||||
|
||||
|
@ -26,6 +26,7 @@
|
||||
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
|
||||
|
||||
typedef struct CinFileHeader {
|
||||
@ -111,7 +112,7 @@ static int cin_read_header(AVFormatContext *s, AVFormatParameters *ap)
|
||||
if (!st)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
av_set_pts_info(st, 32, 1, 12);
|
||||
avpriv_set_pts_info(st, 32, 1, 12);
|
||||
cin->video_stream_index = st->index;
|
||||
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
|
||||
st->codec->codec_id = CODEC_ID_DSICINVIDEO;
|
||||
@ -124,7 +125,7 @@ static int cin_read_header(AVFormatContext *s, AVFormatParameters *ap)
|
||||
if (!st)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
av_set_pts_info(st, 32, 1, 22050);
|
||||
avpriv_set_pts_info(st, 32, 1, 22050);
|
||||
cin->audio_stream_index = st->index;
|
||||
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
|
||||
st->codec->codec_id = CODEC_ID_DSICINAUDIO;
|
||||
|
@ -30,6 +30,7 @@
|
||||
*/
|
||||
#include <time.h>
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "libavcodec/dvdata.h"
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "libavutil/mathematics.h"
|
||||
@ -214,7 +215,7 @@ static int dv_extract_audio_info(DVDemuxContext* c, uint8_t* frame)
|
||||
c->ast[i] = avformat_new_stream(c->fctx, NULL);
|
||||
if (!c->ast[i])
|
||||
break;
|
||||
av_set_pts_info(c->ast[i], 64, 1, 30000);
|
||||
avpriv_set_pts_info(c->ast[i], 64, 1, 30000);
|
||||
c->ast[i]->codec->codec_type = AVMEDIA_TYPE_AUDIO;
|
||||
c->ast[i]->codec->codec_id = CODEC_ID_PCM_S16LE;
|
||||
|
||||
@ -244,7 +245,7 @@ static int dv_extract_video_info(DVDemuxContext *c, uint8_t* frame)
|
||||
if (c->sys) {
|
||||
avctx = c->vst->codec;
|
||||
|
||||
av_set_pts_info(c->vst, 64, c->sys->time_base.num,
|
||||
avpriv_set_pts_info(c->vst, 64, c->sys->time_base.num,
|
||||
c->sys->time_base.den);
|
||||
avctx->time_base= c->sys->time_base;
|
||||
if (!avctx->width){
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "riff.h"
|
||||
|
||||
#define DXA_EXTRA_SIZE 9
|
||||
@ -127,7 +128,7 @@ static int dxa_read_header(AVFormatContext *s, AVFormatParameters *ap)
|
||||
st->codec->width = w;
|
||||
st->codec->height = h;
|
||||
av_reduce(&den, &num, den, num, (1UL<<31)-1);
|
||||
av_set_pts_info(st, 33, num, den);
|
||||
avpriv_set_pts_info(st, 33, num, den);
|
||||
/* flags & 0x80 means that image is interlaced,
|
||||
* flags & 0x40 means that image has double height
|
||||
* either way set true height
|
||||
|
@ -29,6 +29,7 @@
|
||||
*/
|
||||
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
|
||||
typedef struct {
|
||||
unsigned int channels;
|
||||
@ -72,7 +73,7 @@ static int cdata_read_header(AVFormatContext *s, AVFormatParameters *ap)
|
||||
st->codec->codec_id = CODEC_ID_ADPCM_EA_XAS;
|
||||
st->codec->channels = cdata->channels;
|
||||
st->codec->sample_rate = sample_rate;
|
||||
av_set_pts_info(st, 64, 1, sample_rate);
|
||||
avpriv_set_pts_info(st, 64, 1, sample_rate);
|
||||
|
||||
cdata->audio_pts = 0;
|
||||
return 0;
|
||||
|
@ -27,6 +27,7 @@
|
||||
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
|
||||
#define SCHl_TAG MKTAG('S', 'C', 'H', 'l')
|
||||
#define SEAD_TAG MKTAG('S', 'E', 'A', 'D') /* Sxxx header */
|
||||
@ -438,7 +439,7 @@ static int ea_read_header(AVFormatContext *s,
|
||||
st = avformat_new_stream(s, NULL);
|
||||
if (!st)
|
||||
return AVERROR(ENOMEM);
|
||||
av_set_pts_info(st, 33, 1, ea->sample_rate);
|
||||
avpriv_set_pts_info(st, 33, 1, ea->sample_rate);
|
||||
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
|
||||
st->codec->codec_id = ea->audio_codec;
|
||||
st->codec->codec_tag = 0; /* no tag */
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "libavutil/intfloat_readwrite.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "ffm.h"
|
||||
#if CONFIG_AVSERVER
|
||||
#include <unistd.h>
|
||||
@ -294,7 +295,7 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap)
|
||||
if (!st)
|
||||
goto fail;
|
||||
|
||||
av_set_pts_info(st, 64, 1, 1000000);
|
||||
avpriv_set_pts_info(st, 64, 1, 1000000);
|
||||
|
||||
codec = st->codec;
|
||||
/* generic info */
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "libavutil/intfloat_readwrite.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "ffm.h"
|
||||
|
||||
static void flush_packet(AVFormatContext *s)
|
||||
@ -107,7 +108,7 @@ static int ffm_write_header(AVFormatContext *s)
|
||||
/* list of streams */
|
||||
for(i=0;i<s->nb_streams;i++) {
|
||||
st = s->streams[i];
|
||||
av_set_pts_info(st, 64, 1, 1000000);
|
||||
avpriv_set_pts_info(st, 64, 1, 1000000);
|
||||
|
||||
codec = st->codec;
|
||||
/* generic info */
|
||||
|
@ -26,6 +26,7 @@
|
||||
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
|
||||
#define RAND_TAG MKBETAG('R','a','n','d')
|
||||
|
||||
@ -67,7 +68,7 @@ static int read_header(AVFormatContext *s,
|
||||
st->codec->width = avio_rb16(pb);
|
||||
st->codec->height = avio_rb16(pb);
|
||||
film->leading = avio_rb16(pb);
|
||||
av_set_pts_info(st, 64, 1, avio_rb16(pb));
|
||||
avpriv_set_pts_info(st, 64, 1, avio_rb16(pb));
|
||||
|
||||
avio_seek(pb, 0, SEEK_SET);
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
#include "libavcodec/flac.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "rawdec.h"
|
||||
#include "oggdec.h"
|
||||
#include "vorbiscomment.h"
|
||||
@ -91,7 +92,7 @@ static int flac_read_header(AVFormatContext *s,
|
||||
|
||||
/* set time base and duration */
|
||||
if (si.samplerate > 0) {
|
||||
av_set_pts_info(st, 64, 1, si.samplerate);
|
||||
avpriv_set_pts_info(st, 64, 1, si.samplerate);
|
||||
if (si.samples > 0)
|
||||
st->duration = si.samples;
|
||||
}
|
||||
|
@ -34,6 +34,7 @@
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "libavutil/audioconvert.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
|
||||
#define FLIC_FILE_MAGIC_1 0xAF11
|
||||
#define FLIC_FILE_MAGIC_2 0xAF12
|
||||
@ -167,10 +168,10 @@ static int flic_read_header(AVFormatContext *s,
|
||||
/* Since the header information is incorrect we have to figure out the
|
||||
* framerate using block_align and the fact that the audio is 22050 Hz.
|
||||
* We usually have two cases: 2205 -> 10 fps and 1470 -> 15 fps */
|
||||
av_set_pts_info(st, 64, ast->codec->block_align, FLIC_TFTD_SAMPLE_RATE);
|
||||
av_set_pts_info(ast, 64, 1, FLIC_TFTD_SAMPLE_RATE);
|
||||
avpriv_set_pts_info(st, 64, ast->codec->block_align, FLIC_TFTD_SAMPLE_RATE);
|
||||
avpriv_set_pts_info(ast, 64, 1, FLIC_TFTD_SAMPLE_RATE);
|
||||
} else if (AV_RL16(&header[0x10]) == FLIC_CHUNK_MAGIC_1) {
|
||||
av_set_pts_info(st, 64, FLIC_MC_SPEED, 70);
|
||||
avpriv_set_pts_info(st, 64, FLIC_MC_SPEED, 70);
|
||||
|
||||
/* rewind the stream since the first chunk is at offset 12 */
|
||||
avio_seek(pb, 12, SEEK_SET);
|
||||
@ -182,10 +183,10 @@ static int flic_read_header(AVFormatContext *s,
|
||||
memcpy(st->codec->extradata, header, 12);
|
||||
|
||||
} else if (magic_number == FLIC_FILE_MAGIC_1) {
|
||||
av_set_pts_info(st, 64, speed, 70);
|
||||
avpriv_set_pts_info(st, 64, speed, 70);
|
||||
} else if ((magic_number == FLIC_FILE_MAGIC_2) ||
|
||||
(magic_number == FLIC_FILE_MAGIC_3)) {
|
||||
av_set_pts_info(st, 64, speed, 1000);
|
||||
avpriv_set_pts_info(st, 64, speed, 1000);
|
||||
} else {
|
||||
av_log(s, AV_LOG_INFO, "Invalid or unsupported magic chunk in file\n");
|
||||
return AVERROR_INVALIDDATA;
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include "libavcodec/bytestream.h"
|
||||
#include "libavcodec/mpeg4audio.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "avio_internal.h"
|
||||
#include "flv.h"
|
||||
|
||||
@ -360,7 +361,7 @@ static AVStream *create_stream(AVFormatContext *s, int is_audio){
|
||||
return NULL;
|
||||
st->id = is_audio;
|
||||
st->codec->codec_type = is_audio ? AVMEDIA_TYPE_AUDIO : AVMEDIA_TYPE_VIDEO;
|
||||
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 */
|
||||
return st;
|
||||
}
|
||||
|
||||
|
@ -199,7 +199,7 @@ static int flv_write_header(AVFormatContext *s)
|
||||
if(get_audio_flags(enc)<0)
|
||||
return -1;
|
||||
}
|
||||
av_set_pts_info(s->streams[i], 32, 1, 1000); /* 32 bit pts in ms */
|
||||
avpriv_set_pts_info(s->streams[i], 32, 1, 1000); /* 32 bit pts in ms */
|
||||
|
||||
sc = av_mallocz(sizeof(FLVStreamContext));
|
||||
if (!sc)
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "libavutil/mathematics.h"
|
||||
#include "libavutil/opt.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
|
||||
#define GSM_BLOCK_SIZE 33
|
||||
#define GSM_BLOCK_SAMPLES 160
|
||||
@ -67,7 +68,7 @@ static int gsm_read_header(AVFormatContext *s, AVFormatParameters *ap)
|
||||
st->codec->block_align = GSM_BLOCK_SIZE;
|
||||
st->codec->bit_rate = GSM_BLOCK_SIZE * 8 * c->sample_rate / GSM_BLOCK_SAMPLES;
|
||||
|
||||
av_set_pts_info(st, 64, GSM_BLOCK_SAMPLES, GSM_SAMPLE_RATE);
|
||||
avpriv_set_pts_info(st, 64, GSM_BLOCK_SAMPLES, GSM_SAMPLE_RATE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -362,7 +362,7 @@ static int gxf_header(AVFormatContext *s, AVFormatParameters *ap) {
|
||||
main_timebase = (AVRational){1001, 60000};
|
||||
for (i = 0; i < s->nb_streams; i++) {
|
||||
AVStream *st = s->streams[i];
|
||||
av_set_pts_info(st, 32, main_timebase.num, main_timebase.den);
|
||||
avpriv_set_pts_info(st, 32, main_timebase.num, main_timebase.den);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "libavutil/intfloat_readwrite.h"
|
||||
#include "libavutil/mathematics.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "gxf.h"
|
||||
#include "riff.h"
|
||||
#include "audiointerleave.h"
|
||||
@ -676,7 +677,7 @@ static int gxf_write_header(AVFormatContext *s)
|
||||
}
|
||||
sc->track_type = 2;
|
||||
sc->sample_rate = st->codec->sample_rate;
|
||||
av_set_pts_info(st, 64, 1, sc->sample_rate);
|
||||
avpriv_set_pts_info(st, 64, 1, sc->sample_rate);
|
||||
sc->sample_size = 16;
|
||||
sc->frame_rate_index = -2;
|
||||
sc->lines_index = -2;
|
||||
@ -706,7 +707,7 @@ static int gxf_write_header(AVFormatContext *s)
|
||||
"gxf muxer only accepts PAL or NTSC resolutions currently\n");
|
||||
return -1;
|
||||
}
|
||||
av_set_pts_info(st, 64, gxf->time_base.num, gxf->time_base.den);
|
||||
avpriv_set_pts_info(st, 64, gxf->time_base.num, gxf->time_base.den);
|
||||
if (gxf_find_lines_index(st) < 0)
|
||||
sc->lines_index = -1;
|
||||
sc->sample_size = st->codec->bit_rate;
|
||||
|
@ -70,6 +70,7 @@
|
||||
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
|
||||
#define HUFFMAN_TABLE_SIZE (64 * 1024)
|
||||
#define IDCIN_FPS 14
|
||||
@ -156,7 +157,7 @@ static int idcin_read_header(AVFormatContext *s,
|
||||
st = avformat_new_stream(s, NULL);
|
||||
if (!st)
|
||||
return AVERROR(ENOMEM);
|
||||
av_set_pts_info(st, 33, 1, IDCIN_FPS);
|
||||
avpriv_set_pts_info(st, 33, 1, IDCIN_FPS);
|
||||
idcin->video_stream_index = st->index;
|
||||
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
|
||||
st->codec->codec_id = CODEC_ID_IDCIN;
|
||||
@ -177,7 +178,7 @@ static int idcin_read_header(AVFormatContext *s,
|
||||
st = avformat_new_stream(s, NULL);
|
||||
if (!st)
|
||||
return AVERROR(ENOMEM);
|
||||
av_set_pts_info(st, 33, 1, IDCIN_FPS);
|
||||
avpriv_set_pts_info(st, 33, 1, IDCIN_FPS);
|
||||
idcin->audio_stream_index = st->index;
|
||||
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
|
||||
st->codec->codec_tag = 1;
|
||||
|
@ -29,6 +29,7 @@
|
||||
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
|
||||
#define RoQ_MAGIC_NUMBER 0x1084
|
||||
#define RoQ_CHUNK_PREAMBLE_SIZE 8
|
||||
@ -87,7 +88,7 @@ static int roq_read_header(AVFormatContext *s,
|
||||
st = avformat_new_stream(s, NULL);
|
||||
if (!st)
|
||||
return AVERROR(ENOMEM);
|
||||
av_set_pts_info(st, 63, 1, framerate);
|
||||
avpriv_set_pts_info(st, 63, 1, framerate);
|
||||
roq->video_stream_index = st->index;
|
||||
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
|
||||
st->codec->codec_id = CODEC_ID_ROQ;
|
||||
@ -169,7 +170,7 @@ static int roq_read_packet(AVFormatContext *s,
|
||||
AVStream *st = avformat_new_stream(s, NULL);
|
||||
if (!st)
|
||||
return AVERROR(ENOMEM);
|
||||
av_set_pts_info(st, 32, 1, RoQ_AUDIO_SAMPLE_RATE);
|
||||
avpriv_set_pts_info(st, 32, 1, RoQ_AUDIO_SAMPLE_RATE);
|
||||
roq->audio_stream_index = st->index;
|
||||
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
|
||||
st->codec->codec_id = CODEC_ID_ROQ_DPCM;
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "libavutil/dict.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
|
||||
#define ID_8SVX MKTAG('8','S','V','X')
|
||||
#define ID_VHDR MKTAG('V','H','D','R')
|
||||
@ -216,7 +217,7 @@ static int iff_read_header(AVFormatContext *s,
|
||||
|
||||
switch(st->codec->codec_type) {
|
||||
case AVMEDIA_TYPE_AUDIO:
|
||||
av_set_pts_info(st, 32, 1, st->codec->sample_rate);
|
||||
avpriv_set_pts_info(st, 32, 1, st->codec->sample_rate);
|
||||
|
||||
switch(compression) {
|
||||
case COMP_NONE:
|
||||
|
@ -250,7 +250,7 @@ static int read_header(AVFormatContext *s1, AVFormatParameters *ap)
|
||||
st->need_parsing = AVSTREAM_PARSE_FULL;
|
||||
}
|
||||
|
||||
av_set_pts_info(st, 60, framerate.den, framerate.num);
|
||||
avpriv_set_pts_info(st, 60, framerate.den, framerate.num);
|
||||
|
||||
if (width && height) {
|
||||
st->codec->width = width;
|
||||
|
@ -286,4 +286,17 @@ int64_t ff_gen_search(AVFormatContext *s, int stream_index,
|
||||
int flags, int64_t *ts_ret,
|
||||
int64_t (*read_timestamp)(struct AVFormatContext *, int , int64_t *, int64_t ));
|
||||
|
||||
/**
|
||||
* Set the pts for a given stream. If the new values would be invalid
|
||||
* (<= 0), it leaves the AVStream unchanged.
|
||||
*
|
||||
* @param s stream
|
||||
* @param pts_wrap_bits number of bits effectively used by the pts
|
||||
* (used for wrap control, 33 is the value for MPEG)
|
||||
* @param pts_num numerator to convert to seconds (MPEG: 1)
|
||||
* @param pts_den denominator to convert to seconds (MPEG: 90000)
|
||||
*/
|
||||
void avpriv_set_pts_info(AVStream *s, int pts_wrap_bits,
|
||||
unsigned int pts_num, unsigned int pts_den);
|
||||
|
||||
#endif /* AVFORMAT_INTERNAL_H */
|
||||
|
@ -34,6 +34,7 @@
|
||||
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
|
||||
#define CHUNK_PREAMBLE_SIZE 4
|
||||
#define OPCODE_PREAMBLE_SIZE 4
|
||||
@ -562,7 +563,7 @@ static int ipmovie_read_header(AVFormatContext *s,
|
||||
st = avformat_new_stream(s, NULL);
|
||||
if (!st)
|
||||
return AVERROR(ENOMEM);
|
||||
av_set_pts_info(st, 63, 1, 1000000);
|
||||
avpriv_set_pts_info(st, 63, 1, 1000000);
|
||||
ipmovie->video_stream_index = st->index;
|
||||
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
|
||||
st->codec->codec_id = CODEC_ID_INTERPLAY_VIDEO;
|
||||
@ -575,7 +576,7 @@ static int ipmovie_read_header(AVFormatContext *s,
|
||||
st = avformat_new_stream(s, NULL);
|
||||
if (!st)
|
||||
return AVERROR(ENOMEM);
|
||||
av_set_pts_info(st, 32, 1, ipmovie->audio_sample_rate);
|
||||
avpriv_set_pts_info(st, 32, 1, ipmovie->audio_sample_rate);
|
||||
ipmovie->audio_stream_index = st->index;
|
||||
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
|
||||
st->codec->codec_id = ipmovie->audio_type;
|
||||
|
@ -27,6 +27,7 @@
|
||||
*/
|
||||
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "libavutil/avstring.h"
|
||||
|
||||
#define ISS_SIG "IMA_ADPCM_Sound"
|
||||
@ -101,7 +102,7 @@ static av_cold int iss_read_header(AVFormatContext *s, AVFormatParameters *ap)
|
||||
st->codec->bit_rate = st->codec->channels * st->codec->sample_rate
|
||||
* st->codec->bits_per_coded_sample;
|
||||
st->codec->block_align = iss->packet_size;
|
||||
av_set_pts_info(st, 32, 1, st->codec->sample_rate);
|
||||
avpriv_set_pts_info(st, 32, 1, st->codec->sample_rate);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
*/
|
||||
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
|
||||
|
||||
static int probe(AVProbeData *p)
|
||||
@ -47,7 +48,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
|
||||
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
|
||||
st->codec->codec_id = CODEC_ID_MPEG4;
|
||||
st->need_parsing = AVSTREAM_PARSE_FULL;
|
||||
av_set_pts_info(st, 64, 1, 90000);
|
||||
avpriv_set_pts_info(st, 64, 1, 90000);
|
||||
|
||||
return 0;
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
*/
|
||||
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "riff.h"
|
||||
#include "libavutil/intreadwrite.h"
|
||||
|
||||
@ -61,7 +62,7 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
av_set_pts_info(st, 64, time_base.num, time_base.den);
|
||||
avpriv_set_pts_info(st, 64, time_base.num, time_base.den);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -27,6 +27,7 @@
|
||||
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
|
||||
#define JV_PREAMBLE_SIZE 5
|
||||
|
||||
@ -81,7 +82,7 @@ static int read_header(AVFormatContext *s,
|
||||
vst->codec->height = avio_rl16(pb);
|
||||
vst->nb_frames =
|
||||
ast->nb_index_entries = avio_rl16(pb);
|
||||
av_set_pts_info(vst, 64, avio_rl16(pb), 1000);
|
||||
avpriv_set_pts_info(vst, 64, avio_rl16(pb), 1000);
|
||||
|
||||
avio_skip(pb, 4);
|
||||
|
||||
@ -90,7 +91,7 @@ static int read_header(AVFormatContext *s,
|
||||
ast->codec->codec_tag = 0; /* no fourcc */
|
||||
ast->codec->sample_rate = avio_rl16(pb);
|
||||
ast->codec->channels = 1;
|
||||
av_set_pts_info(ast, 64, 1, ast->codec->sample_rate);
|
||||
avpriv_set_pts_info(ast, 64, 1, ast->codec->sample_rate);
|
||||
|
||||
avio_skip(pb, 10);
|
||||
|
||||
|
@ -26,6 +26,7 @@
|
||||
*/
|
||||
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "riff.h"
|
||||
#include <libnut.h>
|
||||
|
||||
@ -92,7 +93,7 @@ static int nut_write_header(AVFormatContext * avf) {
|
||||
for (j = 0; j < s[i].fourcc_len; j++) s[i].fourcc[j] = (fourcc >> (j*8)) & 0xFF;
|
||||
|
||||
ff_parse_specific_params(codec, &num, &ssize, &denom);
|
||||
av_set_pts_info(avf->streams[i], 60, denom, num);
|
||||
avpriv_set_pts_info(avf->streams[i], 60, denom, num);
|
||||
|
||||
s[i].time_base.num = denom;
|
||||
s[i].time_base.den = num;
|
||||
@ -226,7 +227,7 @@ static int nut_read_header(AVFormatContext * avf, AVFormatParameters * ap) {
|
||||
memcpy(st->codec->extradata, s[i].codec_specific, st->codec->extradata_size);
|
||||
}
|
||||
|
||||
av_set_pts_info(avf->streams[i], 60, s[i].time_base.num, s[i].time_base.den);
|
||||
avpriv_set_pts_info(avf->streams[i], 60, s[i].time_base.num, s[i].time_base.den);
|
||||
st->start_time = 0;
|
||||
st->duration = s[i].max_pts;
|
||||
|
||||
|
@ -24,6 +24,7 @@
|
||||
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
|
||||
#define LMLM4_I_FRAME 0x00
|
||||
#define LMLM4_P_FRAME 0x01
|
||||
@ -65,7 +66,7 @@ static int lmlm4_read_header(AVFormatContext *s, AVFormatParameters *ap) {
|
||||
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
|
||||
st->codec->codec_id = CODEC_ID_MPEG4;
|
||||
st->need_parsing = AVSTREAM_PARSE_HEADERS;
|
||||
av_set_pts_info(st, 64, 1001, 30000);
|
||||
avpriv_set_pts_info(st, 64, 1001, 30000);
|
||||
|
||||
if (!(st = avformat_new_stream(s, NULL)))
|
||||
return AVERROR(ENOMEM);
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "riff.h"
|
||||
|
||||
#define LXF_PACKET_HEADER_SIZE 60
|
||||
@ -174,14 +175,14 @@ static int get_packet_header(AVFormatContext *s, uint8_t *header, uint32_t *form
|
||||
//use audio packet size to determine video standard
|
||||
//for NTSC we have one 8008-sample audio frame per five video frames
|
||||
if (samples == LXF_SAMPLERATE * 5005 / 30000) {
|
||||
av_set_pts_info(s->streams[0], 64, 1001, 30000);
|
||||
avpriv_set_pts_info(s->streams[0], 64, 1001, 30000);
|
||||
} else {
|
||||
//assume PAL, but warn if we don't have 1920 samples
|
||||
if (samples != LXF_SAMPLERATE / 25)
|
||||
av_log(s, AV_LOG_WARNING,
|
||||
"video doesn't seem to be PAL or NTSC. guessing PAL\n");
|
||||
|
||||
av_set_pts_info(s->streams[0], 64, 1, 25);
|
||||
avpriv_set_pts_info(s->streams[0], 64, 1, 25);
|
||||
}
|
||||
|
||||
//TODO: warning if track mask != (1 << channels) - 1?
|
||||
@ -250,7 +251,7 @@ static int lxf_read_header(AVFormatContext *s, AVFormatParameters *ap)
|
||||
st->codec->sample_rate = LXF_SAMPLERATE;
|
||||
st->codec->channels = lxf->channels;
|
||||
|
||||
av_set_pts_info(st, 64, 1, st->codec->sample_rate);
|
||||
avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
|
||||
}
|
||||
|
||||
if (format == 1) {
|
||||
|
@ -1506,7 +1506,7 @@ static int matroska_read_header(AVFormatContext *s, AVFormatParameters *ap)
|
||||
|
||||
if (track->time_scale < 0.01)
|
||||
track->time_scale = 1.0;
|
||||
av_set_pts_info(st, 64, matroska->time_scale*track->time_scale, 1000*1000*1000); /* 64 bit pts in ns */
|
||||
avpriv_set_pts_info(st, 64, matroska->time_scale*track->time_scale, 1000*1000*1000); /* 64 bit pts in ns */
|
||||
|
||||
st->codec->codec_id = codec_id;
|
||||
st->start_time = 0;
|
||||
|
@ -20,6 +20,7 @@
|
||||
*/
|
||||
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "riff.h"
|
||||
#include "isom.h"
|
||||
#include "matroska.h"
|
||||
@ -662,7 +663,7 @@ static int mkv_write_tracks(AVFormatContext *s)
|
||||
end_ebml_master(pb, track);
|
||||
|
||||
// ms precision is the de-facto standard timescale for mkv files
|
||||
av_set_pts_info(st, 64, 1, 1000);
|
||||
avpriv_set_pts_info(st, 64, 1, 1000);
|
||||
}
|
||||
end_ebml_master(pb, tracks);
|
||||
return 0;
|
||||
|
@ -33,6 +33,7 @@
|
||||
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
|
||||
#define MM_PREAMBLE_SIZE 6
|
||||
|
||||
@ -113,7 +114,7 @@ static int read_header(AVFormatContext *s,
|
||||
st->codec->codec_tag = 0; /* no fourcc */
|
||||
st->codec->width = width;
|
||||
st->codec->height = height;
|
||||
av_set_pts_info(st, 64, 1, frame_rate);
|
||||
avpriv_set_pts_info(st, 64, 1, frame_rate);
|
||||
|
||||
/* audio stream */
|
||||
if (length == MM_HEADER_LEN_AV) {
|
||||
@ -125,7 +126,7 @@ static int read_header(AVFormatContext *s,
|
||||
st->codec->codec_id = CODEC_ID_PCM_U8;
|
||||
st->codec->channels = 1;
|
||||
st->codec->sample_rate = 8000;
|
||||
av_set_pts_info(st, 64, 1, 8000); /* 8000 hz */
|
||||
avpriv_set_pts_info(st, 64, 1, 8000); /* 8000 hz */
|
||||
}
|
||||
|
||||
mm->audio_pts = 0;
|
||||
|
@ -19,6 +19,7 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "avio_internal.h"
|
||||
#include "pcm.h"
|
||||
#include "riff.h"
|
||||
@ -100,7 +101,7 @@ static int mmf_write_header(AVFormatContext *s)
|
||||
|
||||
mmf->awapos = ff_start_tag(pb, "Awa\x01");
|
||||
|
||||
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);
|
||||
|
||||
avio_flush(pb);
|
||||
|
||||
@ -252,7 +253,7 @@ static int mmf_read_header(AVFormatContext *s,
|
||||
st->codec->bits_per_coded_sample = 4;
|
||||
st->codec->bit_rate = st->codec->sample_rate * st->codec->bits_per_coded_sample;
|
||||
|
||||
av_set_pts_info(st, 64, 1, st->codec->sample_rate);
|
||||
avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include "libavutil/avstring.h"
|
||||
#include "libavutil/dict.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "avio_internal.h"
|
||||
#include "riff.h"
|
||||
#include "isom.h"
|
||||
@ -1827,7 +1828,7 @@ static int mov_read_trak(MOVContext *c, AVIOContext *pb, MOVAtom atom)
|
||||
sc->time_scale = 1;
|
||||
}
|
||||
|
||||
av_set_pts_info(st, 64, 1, sc->time_scale);
|
||||
avpriv_set_pts_info(st, 64, 1, sc->time_scale);
|
||||
|
||||
if (st->codec->codec_type == AVMEDIA_TYPE_AUDIO &&
|
||||
!st->codec->frame_size && sc->stts_count == 1) {
|
||||
|
@ -2258,7 +2258,7 @@ static int mov_write_header(AVFormatContext *s)
|
||||
if (!track->height)
|
||||
track->height = st->codec->height;
|
||||
|
||||
av_set_pts_info(st, 64, 1, track->timescale);
|
||||
avpriv_set_pts_info(st, 64, 1, track->timescale);
|
||||
}
|
||||
|
||||
mov_write_mdat_tag(pb, mov);
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "libavutil/dict.h"
|
||||
#include "libavutil/mathematics.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "id3v2.h"
|
||||
#include "id3v1.h"
|
||||
#include "libavcodec/mpegaudiodecheader.h"
|
||||
@ -147,7 +148,7 @@ static int mp3_read_header(AVFormatContext *s,
|
||||
st->start_time = 0;
|
||||
|
||||
// lcm of all mp3 sample rates
|
||||
av_set_pts_info(st, 64, 1, 14112000);
|
||||
avpriv_set_pts_info(st, 64, 1, 14112000);
|
||||
|
||||
off = avio_tell(s->pb);
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
#include "libavcodec/get_bits.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "apetag.h"
|
||||
#include "id3v1.h"
|
||||
#include "libavutil/dict.h"
|
||||
@ -96,7 +97,7 @@ static int mpc_read_header(AVFormatContext *s, AVFormatParameters *ap)
|
||||
st->codec->extradata = av_mallocz(st->codec->extradata_size+FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
avio_read(s->pb, st->codec->extradata, 16);
|
||||
st->codec->sample_rate = mpc_rate[st->codec->extradata[2] & 3];
|
||||
av_set_pts_info(st, 32, MPC_FRAMESIZE, st->codec->sample_rate);
|
||||
avpriv_set_pts_info(st, 32, MPC_FRAMESIZE, st->codec->sample_rate);
|
||||
/* scan for seekpoints */
|
||||
st->start_time = 0;
|
||||
st->duration = c->fcount;
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "libavcodec/get_bits.h"
|
||||
#include "libavcodec/unary.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "avio_internal.h"
|
||||
|
||||
/// Two-byte MPC tag
|
||||
@ -235,7 +236,7 @@ static int mpc8_read_header(AVFormatContext *s, AVFormatParameters *ap)
|
||||
|
||||
st->codec->channels = (st->codec->extradata[1] >> 4) + 1;
|
||||
st->codec->sample_rate = mpc8_rate[st->codec->extradata[0] >> 5];
|
||||
av_set_pts_info(st, 32, 1152 << (st->codec->extradata[1]&3)*2, st->codec->sample_rate);
|
||||
avpriv_set_pts_info(st, 32, 1152 << (st->codec->extradata[1]&3)*2, st->codec->sample_rate);
|
||||
st->duration = c->samples / (1152 << (st->codec->extradata[1]&3)*2);
|
||||
size -= avio_tell(pb) - pos;
|
||||
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "libavutil/opt.h"
|
||||
#include "libavcodec/put_bits.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "mpeg.h"
|
||||
|
||||
#define MAX_PAYLOAD_SIZE 4096
|
||||
@ -336,7 +337,7 @@ static int mpeg_mux_init(AVFormatContext *ctx)
|
||||
goto fail;
|
||||
st->priv_data = stream;
|
||||
|
||||
av_set_pts_info(st, 64, 1, 90000);
|
||||
avpriv_set_pts_info(st, 64, 1, 90000);
|
||||
|
||||
switch(st->codec->codec_type) {
|
||||
case AVMEDIA_TYPE_AUDIO:
|
||||
|
@ -577,7 +577,7 @@ static void mpegts_find_stream_type(AVStream *st,
|
||||
static int mpegts_set_stream_info(AVStream *st, PESContext *pes,
|
||||
uint32_t stream_type, uint32_t prog_reg_desc)
|
||||
{
|
||||
av_set_pts_info(st, 33, 1, 90000);
|
||||
avpriv_set_pts_info(st, 33, 1, 90000);
|
||||
st->priv_data = pes;
|
||||
st->codec->codec_type = AVMEDIA_TYPE_DATA;
|
||||
st->codec->codec_id = CODEC_ID_NONE;
|
||||
@ -612,7 +612,7 @@ static int mpegts_set_stream_info(AVStream *st, PESContext *pes,
|
||||
}
|
||||
|
||||
sub_st->id = pes->pid;
|
||||
av_set_pts_info(sub_st, 33, 1, 90000);
|
||||
avpriv_set_pts_info(sub_st, 33, 1, 90000);
|
||||
sub_st->priv_data = sub_pes;
|
||||
sub_st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
|
||||
sub_st->codec->codec_id = CODEC_ID_AC3;
|
||||
@ -732,7 +732,7 @@ static int read_sl_header(PESContext *pes, SLConfigDescr *sl, const uint8_t *buf
|
||||
if (cts != AV_NOPTS_VALUE)
|
||||
pes->pts = cts;
|
||||
|
||||
av_set_pts_info(pes->st, sl->timestamp_len, 1, sl->timestamp_res);
|
||||
avpriv_set_pts_info(pes->st, sl->timestamp_len, 1, sl->timestamp_res);
|
||||
|
||||
return (get_bits_count(&gb) + 7) >> 3;
|
||||
}
|
||||
@ -1920,7 +1920,7 @@ static int mpegts_read_header(AVFormatContext *s,
|
||||
st = avformat_new_stream(s, NULL);
|
||||
if (!st)
|
||||
goto fail;
|
||||
av_set_pts_info(st, 60, 1, 27000000);
|
||||
avpriv_set_pts_info(st, 60, 1, 27000000);
|
||||
st->codec->codec_type = AVMEDIA_TYPE_DATA;
|
||||
st->codec->codec_id = CODEC_ID_MPEG2TS;
|
||||
|
||||
|
@ -484,7 +484,7 @@ static int mpegts_write_header(AVFormatContext *s)
|
||||
/* assign pids to each stream */
|
||||
for(i = 0;i < s->nb_streams; i++) {
|
||||
st = s->streams[i];
|
||||
av_set_pts_info(st, 33, 1, 90000);
|
||||
avpriv_set_pts_info(st, 33, 1, 90000);
|
||||
ts_st = av_mallocz(sizeof(MpegTSWriteStream));
|
||||
if (!ts_st)
|
||||
goto fail;
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
#include "libavcodec/bytestream.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
|
||||
#define HEADER_SIZE 24
|
||||
|
||||
@ -84,7 +85,7 @@ static int msnwc_tcp_read_header(AVFormatContext *ctx, AVFormatParameters *ap)
|
||||
codec->codec_id = CODEC_ID_MIMIC;
|
||||
codec->codec_tag = MKTAG('M', 'L', '2', '0');
|
||||
|
||||
av_set_pts_info(st, 32, 1, 1000);
|
||||
avpriv_set_pts_info(st, 32, 1, 1000);
|
||||
|
||||
/* Some files start with "connected\r\n\r\n".
|
||||
* So skip until we find the first byte of struct size */
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "libavutil/bswap.h"
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
|
||||
#define MTV_ASUBCHUNK_DATA_SIZE 500
|
||||
#define MTV_HEADER_SIZE 512
|
||||
@ -120,7 +121,7 @@ static int mtv_read_header(AVFormatContext *s, AVFormatParameters *ap)
|
||||
if(!st)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
av_set_pts_info(st, 64, 1, mtv->video_fps);
|
||||
avpriv_set_pts_info(st, 64, 1, mtv->video_fps);
|
||||
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
|
||||
st->codec->codec_id = CODEC_ID_RAWVIDEO;
|
||||
st->codec->pix_fmt = PIX_FMT_RGB565;
|
||||
@ -136,7 +137,7 @@ static int mtv_read_header(AVFormatContext *s, AVFormatParameters *ap)
|
||||
if(!st)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
av_set_pts_info(st, 64, 1, AUDIO_SAMPLING_RATE);
|
||||
avpriv_set_pts_info(st, 64, 1, AUDIO_SAMPLING_RATE);
|
||||
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
|
||||
st->codec->codec_id = CODEC_ID_MP3;
|
||||
st->codec->bit_rate = mtv->audio_br;
|
||||
|
@ -20,6 +20,7 @@
|
||||
*/
|
||||
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
|
||||
#define MVI_FRAC_BITS 10
|
||||
|
||||
@ -76,14 +77,14 @@ static int read_header(AVFormatContext *s, AVFormatParameters *ap)
|
||||
return AVERROR_INVALIDDATA;
|
||||
}
|
||||
|
||||
av_set_pts_info(ast, 64, 1, ast->codec->sample_rate);
|
||||
avpriv_set_pts_info(ast, 64, 1, ast->codec->sample_rate);
|
||||
ast->codec->codec_type = AVMEDIA_TYPE_AUDIO;
|
||||
ast->codec->codec_id = CODEC_ID_PCM_U8;
|
||||
ast->codec->channels = 1;
|
||||
ast->codec->bits_per_coded_sample = 8;
|
||||
ast->codec->bit_rate = ast->codec->sample_rate * 8;
|
||||
|
||||
av_set_pts_info(vst, 64, msecs_per_frame, 1000000);
|
||||
avpriv_set_pts_info(vst, 64, msecs_per_frame, 1000000);
|
||||
vst->codec->codec_type = AVMEDIA_TYPE_VIDEO;
|
||||
vst->codec->codec_id = CODEC_ID_MOTIONPIXELS;
|
||||
|
||||
|
@ -758,7 +758,7 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
|
||||
if (st->duration == -1)
|
||||
st->duration = AV_NOPTS_VALUE;
|
||||
st->start_time = component->start_position;
|
||||
av_set_pts_info(st, 64, material_track->edit_rate.num, material_track->edit_rate.den);
|
||||
avpriv_set_pts_info(st, 64, material_track->edit_rate.num, material_track->edit_rate.den);
|
||||
|
||||
if (!(source_track->sequence = mxf_resolve_strong_ref(mxf, &source_track->sequence_ref, Sequence))) {
|
||||
av_log(mxf->fc, AV_LOG_ERROR, "could not resolve source track sequence strong ref\n");
|
||||
|
@ -1438,7 +1438,7 @@ static int mxf_write_header(AVFormatContext *s)
|
||||
av_log(s, AV_LOG_ERROR, "unsupported video frame rate\n");
|
||||
return -1;
|
||||
}
|
||||
av_set_pts_info(st, 64, mxf->time_base.num, mxf->time_base.den);
|
||||
avpriv_set_pts_info(st, 64, mxf->time_base.num, mxf->time_base.den);
|
||||
if (s->oformat == &ff_mxf_d10_muxer) {
|
||||
if (st->codec->bit_rate == 50000000)
|
||||
if (mxf->time_base.den == 25) sc->index = 3;
|
||||
@ -1466,7 +1466,7 @@ static int mxf_write_header(AVFormatContext *s)
|
||||
av_log(s, AV_LOG_ERROR, "only 48khz is implemented\n");
|
||||
return -1;
|
||||
}
|
||||
av_set_pts_info(st, 64, 1, st->codec->sample_rate);
|
||||
avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
|
||||
if (s->oformat == &ff_mxf_d10_muxer) {
|
||||
if (st->index != 1) {
|
||||
av_log(s, AV_LOG_ERROR, "MXF D-10 only support one audio track\n");
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "libavcodec/mjpeg.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "avio.h"
|
||||
|
||||
#define DEFAULT_PACKET_SIZE 1024
|
||||
@ -47,7 +48,7 @@ static int mxg_read_header(AVFormatContext *s, AVFormatParameters *ap)
|
||||
return AVERROR(ENOMEM);
|
||||
video_st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
|
||||
video_st->codec->codec_id = CODEC_ID_MXPEG;
|
||||
av_set_pts_info(video_st, 64, 1, 1000000);
|
||||
avpriv_set_pts_info(video_st, 64, 1, 1000000);
|
||||
|
||||
audio_st = avformat_new_stream(s, NULL);
|
||||
if (!audio_st)
|
||||
@ -58,7 +59,7 @@ static int mxg_read_header(AVFormatContext *s, AVFormatParameters *ap)
|
||||
audio_st->codec->sample_rate = 8000;
|
||||
audio_st->codec->bits_per_coded_sample = 8;
|
||||
audio_st->codec->block_align = 1;
|
||||
av_set_pts_info(audio_st, 64, 1, 1000000);
|
||||
avpriv_set_pts_info(audio_st, 64, 1, 1000000);
|
||||
|
||||
mxg->soi_ptr = mxg->buffer_ptr = mxg->buffer = 0;
|
||||
mxg->buffer_size = 0;
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
|
||||
#define NC_VIDEO_FLAG 0x1A5
|
||||
|
||||
@ -54,7 +55,7 @@ static int nc_read_header(AVFormatContext *s, AVFormatParameters *ap)
|
||||
st->codec->codec_id = CODEC_ID_MPEG4;
|
||||
st->need_parsing = AVSTREAM_PARSE_FULL;
|
||||
|
||||
av_set_pts_info(st, 64, 1, 100);
|
||||
avpriv_set_pts_info(st, 64, 1, 100);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
#include "libavutil/mathematics.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "riff.h"
|
||||
#include "libavutil/dict.h"
|
||||
|
||||
@ -457,7 +458,7 @@ static int nsv_parse_NSVs_header(AVFormatContext *s, AVFormatParameters *ap)
|
||||
st->codec->height = vheight;
|
||||
st->codec->bits_per_coded_sample = 24; /* depth XXX */
|
||||
|
||||
av_set_pts_info(st, 64, framerate.den, framerate.num);
|
||||
avpriv_set_pts_info(st, 64, framerate.den, framerate.num);
|
||||
st->start_time = 0;
|
||||
st->duration = av_rescale(nsv->duration, framerate.num, 1000*framerate.den);
|
||||
|
||||
@ -489,7 +490,7 @@ static int nsv_parse_NSVs_header(AVFormatContext *s, AVFormatParameters *ap)
|
||||
st->need_parsing = AVSTREAM_PARSE_FULL; /* for PCM we will read a chunk later and put correct info */
|
||||
|
||||
/* set timebase to common denominator of ms and framerate */
|
||||
av_set_pts_info(st, 64, 1, framerate.num*1000);
|
||||
avpriv_set_pts_info(st, 64, 1, framerate.num*1000);
|
||||
st->start_time = 0;
|
||||
st->duration = (int64_t)nsv->duration * framerate.num;
|
||||
#endif
|
||||
|
@ -374,7 +374,7 @@ static int decode_stream_header(NUTContext *nut){
|
||||
return -1;
|
||||
}
|
||||
stc->time_base= &nut->time_base[stc->time_base_id];
|
||||
av_set_pts_info(s->streams[stream_id], 63, stc->time_base->num, stc->time_base->den);
|
||||
avpriv_set_pts_info(s->streams[stream_id], 63, stc->time_base->num, stc->time_base->den);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -603,7 +603,7 @@ static int nut_write_header(AVFormatContext *s){
|
||||
AVRational time_base;
|
||||
ff_parse_specific_params(st->codec, &time_base.den, &ssize, &time_base.num);
|
||||
|
||||
av_set_pts_info(st, 64, time_base.num, time_base.den);
|
||||
avpriv_set_pts_info(st, 64, time_base.num, time_base.den);
|
||||
|
||||
for(j=0; j<nut->time_base_count; j++){
|
||||
if(!memcmp(&time_base, &nut->time_base[j], sizeof(AVRational))){
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "libavutil/intfloat_readwrite.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "riff.h"
|
||||
|
||||
typedef struct {
|
||||
@ -163,7 +164,7 @@ static int nuv_header(AVFormatContext *s, AVFormatParameters *ap) {
|
||||
vst->codec->bits_per_coded_sample = 10;
|
||||
vst->sample_aspect_ratio = av_d2q(aspect * height / width, 10000);
|
||||
vst->r_frame_rate = av_d2q(fps, 60000);
|
||||
av_set_pts_info(vst, 32, 1, 1000);
|
||||
avpriv_set_pts_info(vst, 32, 1, 1000);
|
||||
} else
|
||||
ctx->v_id = -1;
|
||||
|
||||
@ -179,7 +180,7 @@ static int nuv_header(AVFormatContext *s, AVFormatParameters *ap) {
|
||||
ast->codec->bit_rate = 2 * 2 * 44100 * 8;
|
||||
ast->codec->block_align = 2 * 2;
|
||||
ast->codec->bits_per_coded_sample = 16;
|
||||
av_set_pts_info(ast, 32, 1, 1000);
|
||||
avpriv_set_pts_info(ast, 32, 1, 1000);
|
||||
} else
|
||||
ctx->a_id = -1;
|
||||
|
||||
|
@ -178,7 +178,7 @@ static int ogg_new_stream(AVFormatContext *s, uint32_t serial, int new_avstream)
|
||||
return AVERROR(ENOMEM);
|
||||
|
||||
st->id = idx;
|
||||
av_set_pts_info(st, 64, 1, 1000000);
|
||||
avpriv_set_pts_info(st, 64, 1, 1000000);
|
||||
}
|
||||
|
||||
return idx;
|
||||
|
@ -323,9 +323,9 @@ static int ogg_write_header(AVFormatContext *s)
|
||||
unsigned serial_num = i;
|
||||
|
||||
if (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);
|
||||
else if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO)
|
||||
av_set_pts_info(st, 64, st->codec->time_base.num, st->codec->time_base.den);
|
||||
avpriv_set_pts_info(st, 64, st->codec->time_base.num, st->codec->time_base.den);
|
||||
if (st->codec->codec_id != CODEC_ID_VORBIS &&
|
||||
st->codec->codec_id != CODEC_ID_THEORA &&
|
||||
st->codec->codec_id != CODEC_ID_SPEEX &&
|
||||
|
@ -23,6 +23,7 @@
|
||||
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "oggdec.h"
|
||||
|
||||
struct oggcelt_private {
|
||||
@ -71,7 +72,7 @@ static int celt_header(AVFormatContext *s, int idx)
|
||||
st->codec->extradata = extradata;
|
||||
st->codec->extradata_size = 2 * sizeof(uint32_t);
|
||||
if (sample_rate)
|
||||
av_set_pts_info(st, 64, 1, sample_rate);
|
||||
avpriv_set_pts_info(st, 64, 1, sample_rate);
|
||||
priv->extra_headers_left = 1 + extra_headers;
|
||||
os->private = priv;
|
||||
AV_WL32(extradata + 0, overlap);
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "libavcodec/get_bits.h"
|
||||
#include "libavcodec/dirac.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "oggdec.h"
|
||||
|
||||
static int dirac_header(AVFormatContext *s, int idx)
|
||||
@ -42,7 +43,7 @@ static int dirac_header(AVFormatContext *s, int idx)
|
||||
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
|
||||
st->codec->codec_id = CODEC_ID_DIRAC;
|
||||
// dirac in ogg always stores timestamps as though the video were interlaced
|
||||
av_set_pts_info(st, 64, st->codec->time_base.num, 2*st->codec->time_base.den);
|
||||
avpriv_set_pts_info(st, 64, st->codec->time_base.num, 2*st->codec->time_base.den);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -79,7 +80,7 @@ static int old_dirac_header(AVFormatContext *s, int idx)
|
||||
|
||||
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
|
||||
st->codec->codec_id = CODEC_ID_DIRAC;
|
||||
av_set_pts_info(st, 64, AV_RB32(buf+12), AV_RB32(buf+8));
|
||||
avpriv_set_pts_info(st, 64, AV_RB32(buf+12), AV_RB32(buf+8));
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include "libavcodec/get_bits.h"
|
||||
#include "libavcodec/flac.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "oggdec.h"
|
||||
|
||||
#define OGG_FLAC_METADATA_TYPE_STREAMINFO 0x7F
|
||||
@ -65,7 +66,7 @@ flac_header (AVFormatContext * s, int idx)
|
||||
memcpy(st->codec->extradata, streaminfo_start, FLAC_STREAMINFO_SIZE);
|
||||
st->codec->extradata_size = FLAC_STREAMINFO_SIZE;
|
||||
|
||||
av_set_pts_info(st, 64, 1, st->codec->sample_rate);
|
||||
avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
|
||||
} else if (mdt == FLAC_METADATA_TYPE_VORBIS_COMMENT) {
|
||||
ff_vorbis_comment (s, &st->metadata, os->buf + os->pstart + 4, os->psize - 4);
|
||||
}
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "libavcodec/get_bits.h"
|
||||
#include "libavcodec/bytestream.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "oggdec.h"
|
||||
#include "riff.h"
|
||||
|
||||
@ -81,13 +82,13 @@ ogm_header(AVFormatContext *s, int idx)
|
||||
st->codec->height = bytestream_get_le32(&p);
|
||||
st->codec->time_base.den = spu * 10000000;
|
||||
st->codec->time_base.num = time_unit;
|
||||
av_set_pts_info(st, 64, st->codec->time_base.num, st->codec->time_base.den);
|
||||
avpriv_set_pts_info(st, 64, st->codec->time_base.num, st->codec->time_base.den);
|
||||
} else {
|
||||
st->codec->channels = bytestream_get_le16(&p);
|
||||
p += 2; /* block_align */
|
||||
st->codec->bit_rate = bytestream_get_le32(&p) * 8;
|
||||
st->codec->sample_rate = spu * 10000000 / time_unit;
|
||||
av_set_pts_info(st, 64, 1, st->codec->sample_rate);
|
||||
avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
|
||||
}
|
||||
} else if (*p == 3) {
|
||||
if (os->psize > 8)
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
#include "libavcodec/bytestream.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "oggdec.h"
|
||||
|
||||
static int skeleton_header(AVFormatContext *s, int idx)
|
||||
@ -62,7 +63,7 @@ static int skeleton_header(AVFormatContext *s, int idx)
|
||||
if (start_den) {
|
||||
int base_den;
|
||||
av_reduce(&start_time, &base_den, start_num, start_den, INT_MAX);
|
||||
av_set_pts_info(st, 64, 1, base_den);
|
||||
avpriv_set_pts_info(st, 64, 1, base_den);
|
||||
os->lastpts =
|
||||
st->start_time = start_time;
|
||||
}
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include "libavcodec/get_bits.h"
|
||||
#include "libavcodec/bytestream.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "oggdec.h"
|
||||
|
||||
struct speex_params {
|
||||
@ -69,7 +70,7 @@ static int speex_header(AVFormatContext *s, int idx) {
|
||||
+ FF_INPUT_BUFFER_PADDING_SIZE);
|
||||
memcpy(st->codec->extradata, p, st->codec->extradata_size);
|
||||
|
||||
av_set_pts_info(st, 64, 1, st->codec->sample_rate);
|
||||
avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
|
||||
} else
|
||||
ff_vorbis_comment(s, &st->metadata, p, os->psize);
|
||||
|
||||
|
@ -26,6 +26,7 @@
|
||||
#include "libavutil/bswap.h"
|
||||
#include "libavcodec/get_bits.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "oggdec.h"
|
||||
|
||||
struct theora_params {
|
||||
@ -91,7 +92,7 @@ theora_header (AVFormatContext * s, int idx)
|
||||
st->codec->time_base.num = 1;
|
||||
st->codec->time_base.den = 25;
|
||||
}
|
||||
av_set_pts_info(st, 64, st->codec->time_base.num, st->codec->time_base.den);
|
||||
avpriv_set_pts_info(st, 64, st->codec->time_base.num, st->codec->time_base.den);
|
||||
|
||||
st->sample_aspect_ratio.num = get_bits_long(&gb, 24);
|
||||
st->sample_aspect_ratio.den = get_bits_long(&gb, 24);
|
||||
|
@ -254,7 +254,7 @@ vorbis_header (AVFormatContext * s, int idx)
|
||||
|
||||
if (srate > 0) {
|
||||
st->codec->sample_rate = srate;
|
||||
av_set_pts_info(st, 64, 1, srate);
|
||||
avpriv_set_pts_info(st, 64, 1, srate);
|
||||
}
|
||||
} else if (os->buf[os->pstart] == 3) {
|
||||
if (os->psize > 8 &&
|
||||
|
@ -41,6 +41,7 @@
|
||||
*/
|
||||
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "libavutil/des.h"
|
||||
#include "pcm.h"
|
||||
@ -343,14 +344,14 @@ static int oma_read_header(AVFormatContext *s,
|
||||
AV_WL16(&edata[10], 1); // always 1
|
||||
// AV_WL16(&edata[12], 0); // always 0
|
||||
|
||||
av_set_pts_info(st, 64, 1, st->codec->sample_rate);
|
||||
avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
|
||||
break;
|
||||
case OMA_CODECID_ATRAC3P:
|
||||
st->codec->channels = (codec_params >> 10) & 7;
|
||||
framesize = ((codec_params & 0x3FF) * 8) + 8;
|
||||
st->codec->sample_rate = srate_tab[(codec_params >> 13) & 7]*100;
|
||||
st->codec->bit_rate = st->codec->sample_rate * framesize * 8 / 1024;
|
||||
av_set_pts_info(st, 64, 1, st->codec->sample_rate);
|
||||
avpriv_set_pts_info(st, 64, 1, st->codec->sample_rate);
|
||||
av_log(s, AV_LOG_ERROR, "Unsupported codec ATRAC3+!\n");
|
||||
break;
|
||||
case OMA_CODECID_MP3:
|
||||
|
@ -31,6 +31,7 @@
|
||||
|
||||
#include "libavutil/intreadwrite.h"
|
||||
#include "avformat.h"
|
||||
#include "internal.h"
|
||||
|
||||
#define RIFF_TAG MKTAG('R', 'I', 'F', 'F')
|
||||
#define CDXA_TAG MKTAG('C', 'D', 'X', 'A')
|
||||
@ -165,7 +166,7 @@ static int str_read_packet(AVFormatContext *s,
|
||||
st = avformat_new_stream(s, NULL);
|
||||
if (!st)
|
||||
return AVERROR(ENOMEM);
|
||||
av_set_pts_info(st, 64, 1, 15);
|
||||
avpriv_set_pts_info(st, 64, 1, 15);
|
||||
|
||||
str->channels[channel].video_stream_index = st->index;
|
||||
|
||||
@ -224,7 +225,7 @@ static int str_read_packet(AVFormatContext *s,
|
||||
// st->codec->bit_rate = 0; //FIXME;
|
||||
st->codec->block_align = 128;
|
||||
|
||||
av_set_pts_info(st, 64, 128, st->codec->sample_rate);
|
||||
avpriv_set_pts_info(st, 64, 128, st->codec->sample_rate);
|
||||
}
|
||||
pkt = ret_pkt;
|
||||
if (av_new_packet(pkt, 2304))
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user