Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
External Wiki
External Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BC
public
external
ffmpeg
Commits
c3f9ebf7
Commit
c3f9ebf7
authored
Nov 29, 2011
by
Anton Khirnov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavf: make av_set_pts_info private.
It's supposed to be called only from (de)muxers.
parent
06d7325a
Changes
139
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
139 changed files
with
338 additions
and
205 deletions
+338
-205
alsa-audio-dec.c
libavdevice/alsa-audio-dec.c
+2
-1
bktr.c
libavdevice/bktr.c
+2
-1
fbdev.c
libavdevice/fbdev.c
+2
-1
jack_audio.c
libavdevice/jack_audio.c
+2
-1
libcdio.c
libavdevice/libcdio.c
+1
-1
libdc1394.c
libavdevice/libdc1394.c
+2
-1
oss_audio.c
libavdevice/oss_audio.c
+2
-1
pulse.c
libavdevice/pulse.c
+2
-1
sndio_dec.c
libavdevice/sndio_dec.c
+2
-1
v4l.c
libavdevice/v4l.c
+2
-1
v4l2.c
libavdevice/v4l2.c
+2
-1
vfwcap.c
libavdevice/vfwcap.c
+2
-1
x11grab.c
libavdevice/x11grab.c
+2
-1
4xm.c
libavformat/4xm.c
+3
-2
aacdec.c
libavformat/aacdec.c
+2
-1
adxdec.c
libavformat/adxdec.c
+2
-1
aiffdec.c
libavformat/aiffdec.c
+2
-1
aiffenc.c
libavformat/aiffenc.c
+2
-1
amr.c
libavformat/amr.c
+2
-1
anm.c
libavformat/anm.c
+2
-1
ape.c
libavformat/ape.c
+2
-1
asfdec.c
libavformat/asfdec.c
+2
-1
asfenc.c
libavformat/asfenc.c
+2
-1
assdec.c
libavformat/assdec.c
+1
-1
au.c
libavformat/au.c
+2
-1
avformat.h
libavformat/avformat.h
+4
-8
avidec.c
libavformat/avidec.c
+3
-2
avienc.c
libavformat/avienc.c
+2
-1
avisynth.c
libavformat/avisynth.c
+2
-1
bethsoftvid.c
libavformat/bethsoftvid.c
+2
-1
bfi.c
libavformat/bfi.c
+3
-2
bink.c
libavformat/bink.c
+3
-2
bmv.c
libavformat/bmv.c
+3
-2
c93.c
libavformat/c93.c
+2
-1
cafdec.c
libavformat/cafdec.c
+2
-1
cdg.c
libavformat/cdg.c
+2
-1
dfa.c
libavformat/dfa.c
+2
-1
dsicin.c
libavformat/dsicin.c
+3
-2
dv.c
libavformat/dv.c
+3
-2
dxa.c
libavformat/dxa.c
+2
-1
eacdata.c
libavformat/eacdata.c
+2
-1
electronicarts.c
libavformat/electronicarts.c
+2
-1
ffmdec.c
libavformat/ffmdec.c
+2
-1
ffmenc.c
libavformat/ffmenc.c
+2
-1
filmstripdec.c
libavformat/filmstripdec.c
+2
-1
flacdec.c
libavformat/flacdec.c
+2
-1
flic.c
libavformat/flic.c
+6
-5
flvdec.c
libavformat/flvdec.c
+2
-1
flvenc.c
libavformat/flvenc.c
+1
-1
gsmdec.c
libavformat/gsmdec.c
+2
-1
gxf.c
libavformat/gxf.c
+1
-1
gxfenc.c
libavformat/gxfenc.c
+3
-2
idcin.c
libavformat/idcin.c
+3
-2
idroqdec.c
libavformat/idroqdec.c
+3
-2
iff.c
libavformat/iff.c
+2
-1
img2.c
libavformat/img2.c
+1
-1
internal.h
libavformat/internal.h
+13
-0
ipmovie.c
libavformat/ipmovie.c
+3
-2
iss.c
libavformat/iss.c
+2
-1
iv8.c
libavformat/iv8.c
+2
-1
ivfdec.c
libavformat/ivfdec.c
+2
-1
jvdec.c
libavformat/jvdec.c
+3
-2
libnut.c
libavformat/libnut.c
+3
-2
lmlm4.c
libavformat/lmlm4.c
+2
-1
lxfdec.c
libavformat/lxfdec.c
+4
-3
matroskadec.c
libavformat/matroskadec.c
+1
-1
matroskaenc.c
libavformat/matroskaenc.c
+2
-1
mm.c
libavformat/mm.c
+3
-2
mmf.c
libavformat/mmf.c
+3
-2
mov.c
libavformat/mov.c
+2
-1
movenc.c
libavformat/movenc.c
+1
-1
mp3dec.c
libavformat/mp3dec.c
+2
-1
mpc.c
libavformat/mpc.c
+2
-1
mpc8.c
libavformat/mpc8.c
+2
-1
mpegenc.c
libavformat/mpegenc.c
+2
-1
mpegts.c
libavformat/mpegts.c
+4
-4
mpegtsenc.c
libavformat/mpegtsenc.c
+1
-1
msnwc_tcp.c
libavformat/msnwc_tcp.c
+2
-1
mtv.c
libavformat/mtv.c
+3
-2
mvi.c
libavformat/mvi.c
+3
-2
mxfdec.c
libavformat/mxfdec.c
+1
-1
mxfenc.c
libavformat/mxfenc.c
+2
-2
mxg.c
libavformat/mxg.c
+3
-2
ncdec.c
libavformat/ncdec.c
+2
-1
nsvdec.c
libavformat/nsvdec.c
+3
-2
nutdec.c
libavformat/nutdec.c
+1
-1
nutenc.c
libavformat/nutenc.c
+1
-1
nuv.c
libavformat/nuv.c
+3
-2
oggdec.c
libavformat/oggdec.c
+1
-1
oggenc.c
libavformat/oggenc.c
+2
-2
oggparsecelt.c
libavformat/oggparsecelt.c
+2
-1
oggparsedirac.c
libavformat/oggparsedirac.c
+3
-2
oggparseflac.c
libavformat/oggparseflac.c
+2
-1
oggparseogm.c
libavformat/oggparseogm.c
+3
-2
oggparseskeleton.c
libavformat/oggparseskeleton.c
+2
-1
oggparsespeex.c
libavformat/oggparsespeex.c
+2
-1
oggparsetheora.c
libavformat/oggparsetheora.c
+2
-1
oggparsevorbis.c
libavformat/oggparsevorbis.c
+1
-1
oma.c
libavformat/oma.c
+3
-2
psxstr.c
libavformat/psxstr.c
+3
-2
pva.c
libavformat/pva.c
+3
-2
r3d.c
libavformat/r3d.c
+3
-2
rawdec.c
libavformat/rawdec.c
+4
-3
rl2.c
libavformat/rl2.c
+3
-2
rmdec.c
libavformat/rmdec.c
+2
-1
rpl.c
libavformat/rpl.c
+3
-2
rsodec.c
libavformat/rsodec.c
+1
-1
rtpdec_asf.c
libavformat/rtpdec_asf.c
+2
-1
rtpdec_qt.c
libavformat/rtpdec_qt.c
+2
-1
rtpenc.c
libavformat/rtpenc.c
+3
-3
rtsp.c
libavformat/rtsp.c
+3
-3
segafilm.c
libavformat/segafilm.c
+2
-1
sierravmd.c
libavformat/sierravmd.c
+4
-3
siff.c
libavformat/siff.c
+3
-2
smacker.c
libavformat/smacker.c
+3
-2
sol.c
libavformat/sol.c
+2
-1
soxdec.c
libavformat/soxdec.c
+2
-1
srtdec.c
libavformat/srtdec.c
+1
-1
swfdec.c
libavformat/swfdec.c
+3
-3
thp.c
libavformat/thp.c
+3
-2
tiertexseq.c
libavformat/tiertexseq.c
+3
-2
tmv.c
libavformat/tmv.c
+3
-2
tta.c
libavformat/tta.c
+2
-1
tty.c
libavformat/tty.c
+2
-1
utils.c
libavformat/utils.c
+9
-1
vc1test.c
libavformat/vc1test.c
+3
-2
vc1testenc.c
libavformat/vc1testenc.c
+2
-1
version.h
libavformat/version.h
+3
-0
vqf.c
libavformat/vqf.c
+2
-1
wav.c
libavformat/wav.c
+4
-3
wc3movie.c
libavformat/wc3movie.c
+3
-2
westwood.c
libavformat/westwood.c
+4
-3
wtv.c
libavformat/wtv.c
+1
-1
wv.c
libavformat/wv.c
+2
-1
xa.c
libavformat/xa.c
+2
-1
xmv.c
libavformat/xmv.c
+3
-2
xwma.c
libavformat/xwma.c
+2
-1
yop.c
libavformat/yop.c
+2
-1
yuv4mpeg.c
libavformat/yuv4mpeg.c
+2
-1
No files found.
libavdevice/alsa-audio-dec.c
View file @
c3f9ebf7
...
...
@@ -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 */
av
priv
_set_pts_info
(
st
,
64
,
1
,
1000000
);
/* 64 bits pts in us */
return
0
;
...
...
libavdevice/bktr.c
View file @
c3f9ebf7
...
...
@@ -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 */
av
priv
_set_pts_info
(
st
,
64
,
1
,
1000000
);
/* 64 bits pts in use */
s
->
width
=
width
;
s
->
height
=
height
;
...
...
libavdevice/fbdev.c
View file @
c3f9ebf7
...
...
@@ -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 */
av
priv
_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
)
...
...
libavdevice/jack_audio.c
View file @
c3f9ebf7
...
...
@@ -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 */
av
priv
_set_pts_info
(
stream
,
64
,
1
,
1000000
);
/* 64 bits pts in us */
return
0
;
}
...
...
libavdevice/libcdio.c
View file @
c3f9ebf7
...
...
@@ -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
);
av
priv
_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
];
...
...
libavdevice/libdc1394.c
View file @
c3f9ebf7
...
...
@@ -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
);
av
priv
_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
;
...
...
libavdevice/oss_audio.c
View file @
c3f9ebf7
...
...
@@ -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 */
av
priv
_set_pts_info
(
st
,
64
,
1
,
1000000
);
/* 64 bits pts in us */
return
0
;
}
...
...
libavdevice/pulse.c
View file @
c3f9ebf7
...
...
@@ -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 */
av
priv
_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
)
/
...
...
libavdevice/sndio_dec.c
View file @
c3f9ebf7
...
...
@@ -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 */
av
priv
_set_pts_info
(
st
,
64
,
1
,
1000000
);
/* 64 bits pts in us */
return
0
;
}
...
...
libavdevice/v4l.c
View file @
c3f9ebf7
...
...
@@ -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 */
av
priv
_set_pts_info
(
st
,
64
,
1
,
1000000
);
/* 64 bits pts in us */
video_fd
=
open
(
s1
->
filename
,
O_RDWR
);
if
(
video_fd
<
0
)
{
...
...
libavdevice/v4l2.c
View file @
c3f9ebf7
...
...
@@ -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 */
av
priv
_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
);
...
...
libavdevice/vfwcap.c
View file @
c3f9ebf7
...
...
@@ -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
);
av
priv
_set_pts_info
(
st
,
32
,
1
,
1000
);
ctx
->
mutex
=
CreateMutex
(
NULL
,
0
,
NULL
);
if
(
!
ctx
->
mutex
)
{
...
...
libavdevice/x11grab.c
View file @
c3f9ebf7
...
...
@@ -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 */
av
priv
_set_pts_info
(
st
,
64
,
1
,
1000000
);
/* 64 bits pts in us */
screen
=
DefaultScreen
(
dpy
);
...
...
libavformat/4xm.c
View file @
c3f9ebf7
...
...
@@ -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
);
av
priv
_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
);
av
priv
_set_pts_info
(
st
,
60
,
1
,
fourxm
->
tracks
[
current_track
].
sample_rate
);
fourxm
->
tracks
[
current_track
].
stream_index
=
st
->
index
;
...
...
libavformat/aacdec.c
View file @
c3f9ebf7
...
...
@@ -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
);
av
priv
_set_pts_info
(
st
,
64
,
1
,
28224000
);
return
0
;
}
...
...
libavformat/adxdec.c
View file @
c3f9ebf7
...
...
@@ -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
);
av
priv
_set_pts_info
(
st
,
64
,
BLOCK_SAMPLES
,
avctx
->
sample_rate
);
return
0
;
}
...
...
libavformat/aiffdec.c
View file @
c3f9ebf7
...
...
@@ -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
);
av
priv
_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
;
...
...
libavformat/aiffenc.c
View file @
c3f9ebf7
...
...
@@ -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
);
av
priv
_set_pts_info
(
s
->
streams
[
0
],
64
,
1
,
s
->
streams
[
0
]
->
codec
->
sample_rate
);
/* Data is starting here */
avio_flush
(
pb
);
...
...
libavformat/amr.c
View file @
c3f9ebf7
...
...
@@ -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
);
av
priv
_set_pts_info
(
st
,
64
,
1
,
st
->
codec
->
sample_rate
);
return
0
;
}
...
...
libavformat/anm.c
View file @
c3f9ebf7
...
...
@@ -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
));
av
priv
_set_pts_info
(
st
,
64
,
1
,
avio_rl16
(
pb
));
avio_skip
(
pb
,
58
);
/* color cycling and palette data */
...
...
libavformat/ape.c
View file @
c3f9ebf7
...
...
@@ -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
);
av
priv
_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
;
...
...
libavformat/asfdec.c
View file @
c3f9ebf7
...
...
@@ -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 */
av
priv
_set_pts_info
(
st
,
32
,
1
,
1000
);
/* 32 bit pts in ms */
asf_st
=
av_mallocz
(
sizeof
(
ASFStream
));
if
(
!
asf_st
)
return
AVERROR
(
ENOMEM
);
...
...
libavformat/asfenc.c
View file @
c3f9ebf7
...
...
@@ -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 */
av
priv
_set_pts_info
(
s
->
streams
[
n
],
32
,
1
,
1000
);
/* 32 bit pts in ms */
bit_rate
+=
enc
->
bit_rate
;
}
...
...
libavformat/assdec.c
View file @
c3f9ebf7
...
...
@@ -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
);
av
priv
_set_pts_info
(
st
,
64
,
1
,
100
);
st
->
codec
->
codec_type
=
AVMEDIA_TYPE_SUBTITLE
;
st
->
codec
->
codec_id
=
CODEC_ID_SSA
;
...
...
libavformat/au.c
View file @
c3f9ebf7
...
...
@@ -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
);
av
priv
_set_pts_info
(
st
,
64
,
1
,
rate
);
return
0
;
}
...
...
libavformat/avformat.h
View file @
c3f9ebf7
...
...
@@ -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
...
...
libavformat/avidec.c
View file @
c3f9ebf7
...
...
@@ -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
);
av
priv
_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
);
av
priv
_set_pts_info
(
st
,
64
,
time_base
.
num
,
time_base
.
den
);
}
ast
->
sub_buffer
=
pkt
->
data
;
memset
(
pkt
,
0
,
sizeof
(
*
pkt
));
...
...
libavformat/avienc.c
View file @
c3f9ebf7
...
...
@@ -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
);
av
priv
_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 */
...
...
libavformat/avisynth.c
View file @
c3f9ebf7
...
...
@@ -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
);
av
priv
_set_pts_info
(
st
,
64
,
info
.
dwScale
,
info
.
dwRate
);
st
->
start_time
=
stream
->
info
.
dwStart
;
}
}
...
...
libavformat/bethsoftvid.c
View file @
c3f9ebf7
...
...
@@ -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
av
priv
_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
);
...
...
libavformat/bfi.c
View file @
c3f9ebf7
...
...
@@ -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
);
av
priv
_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
);
av
priv
_set_pts_info
(
astream
,
64
,
1
,
astream
->
codec
->
sample_rate
);
return
0
;
}
...
...
libavformat/bink.c
View file @
c3f9ebf7
...
...
@@ -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
);
av
priv
_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
);
av
priv
_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
;
...
...
libavformat/bmv.c
View file @
c3f9ebf7
...
...
@@ -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
);
av
priv
_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
);
av
priv
_set_pts_info
(
ast
,
16
,
1
,
22050
);
c
->
get_next
=
1
;
c
->
audio_pos
=
0
;
...
...
libavformat/c93.c
View file @
c3f9ebf7
...
...
@@ -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
);
av
priv
_set_pts_info
(
video
,
64
,
2
,
25
);
video
->
nb_frames
=
framecount
;
video
->
duration
=
framecount
;
video
->
start_time
=
0
;
...
...
libavformat/cafdec.c
View file @
c3f9ebf7
...
...
@@ -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
);
av
priv
_set_pts_info
(
st
,
64
,
1
,
st
->
codec
->
sample_rate
);
st
->
start_time
=
0
;
/* position the stream at the start of data */
...
...
libavformat/cdg.c
View file @
c3f9ebf7
...
...
@@ -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
);
av
priv
_set_pts_info
(
vst
,
32
,
1
,
300
);
ret
=
avio_size
(
s
->
pb
);
if
(
ret
>
0
)
...
...
libavformat/dfa.c
View file @
c3f9ebf7
...
...
@@ -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
);
av
priv
_set_pts_info
(
st
,
24
,
mspf
,
1000
);
avio_skip
(
pb
,
128
-
16
);
// padding
st
->
duration
=
frames
;
...
...
libavformat/dsicin.c
View file @
c3f9ebf7
...
...
@@ -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
);
av
priv
_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
);
av
priv
_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
;
...
...