aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-12-12 01:25:37 +0100
committerMichael Niedermayer <michaelni@gmx.at>2011-12-12 01:25:37 +0100
commit7fad19a63dc52db4bf2bebbd9d261675956b1b34 (patch)
tree8997428f45d54f3177dc6cd208d0375daa6fe201 /libavformat
parent16abd687798bbf9192ba4954765e61de96065b8b (diff)
parent599b4c6efddaed33b1667c386b34b07729ba732b (diff)
downloadffmpeg-7fad19a63dc52db4bf2bebbd9d261675956b1b34.tar.gz
Merge remote-tracking branch 'qatar/master'
* qatar/master: x86: cabac: replace explicit memory references with "m" operands avplay: don't request a stereo downmix wmapro: use av_float2int() lavc: avoid invalid memcpy() in avcodec_default_release_buffer() lavu: replace int/float punning functions lavfi: install libavfilter/vsrc_buffer.h Remove extraneous semicolons sdp: Restore the original mp4 format h264 extradata if converted rtpenc: Add support for mp4 format h264 rtpenc: Simplify code by introducing a separate end pointer movenc: Use the actual converted sample for RTP hinting Fix a bunch of common typos. Conflicts: doc/developer.texi doc/eval.texi doc/filters.texi doc/protocols.texi ffmpeg.c ffplay.c libavcodec/mpegvideo.h libavcodec/x86/cabac.h libavfilter/Makefile libavformat/avformat.h libavformat/cafdec.c libavformat/flvdec.c libavformat/flvenc.c libavformat/gxfenc.c libavformat/img2.c libavformat/movenc.c libavformat/mpegts.c libavformat/rtpenc_h264.c libavformat/utils.c libavformat/wtv.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/4xm.c4
-rw-r--r--libavformat/aiffdec.c10
-rw-r--r--libavformat/aiffenc.c9
-rw-r--r--libavformat/avformat.h7
-rw-r--r--libavformat/cafdec.c4
-rw-r--r--libavformat/ffmdec.c16
-rw-r--r--libavformat/ffmenc.c16
-rw-r--r--libavformat/flvdec.c6
-rw-r--r--libavformat/flvenc.c6
-rw-r--r--libavformat/gxfenc.c6
-rw-r--r--libavformat/http.c2
-rw-r--r--libavformat/id3v2.c2
-rw-r--r--libavformat/img2.c2
-rw-r--r--libavformat/iv8.c2
-rw-r--r--libavformat/matroskadec.c8
-rw-r--r--libavformat/matroskaenc.c4
-rw-r--r--libavformat/mms.h2
-rw-r--r--libavformat/mov.c4
-rw-r--r--libavformat/movenc.c25
-rw-r--r--libavformat/movenc.h3
-rw-r--r--libavformat/movenchint.c17
-rw-r--r--libavformat/mpegts.c2
-rw-r--r--libavformat/mpegtsenc.c2
-rw-r--r--libavformat/mxfenc.c2
-rw-r--r--libavformat/nuv.c6
-rw-r--r--libavformat/rdt.c2
-rw-r--r--libavformat/rtmppkt.c8
-rw-r--r--libavformat/rtmpproto.c6
-rw-r--r--libavformat/rtp.h2
-rw-r--r--libavformat/rtpenc_h264.c33
-rw-r--r--libavformat/sdp.c17
-rw-r--r--libavformat/soxdec.c6
-rw-r--r--libavformat/soxenc.c6
-rw-r--r--libavformat/thp.c4
-rw-r--r--libavformat/udp.c2
-rw-r--r--libavformat/utils.c2
36 files changed, 147 insertions, 108 deletions
diff --git a/libavformat/4xm.c b/libavformat/4xm.c
index 03ce4ca056..3d9c5aea12 100644
--- a/libavformat/4xm.c
+++ b/libavformat/4xm.c
@@ -28,7 +28,7 @@
*/
#include "libavutil/intreadwrite.h"
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
#include "avformat.h"
#include "internal.h"
@@ -131,7 +131,7 @@ static int fourxm_read_header(AVFormatContext *s,
size = AV_RL32(&header[i + 4]);
if (fourcc_tag == std__TAG) {
- fourxm->fps = av_int2flt(AV_RL32(&header[i + 12]));
+ fourxm->fps = av_int2float(AV_RL32(&header[i + 12]));
} else if (fourcc_tag == vtrk_TAG) {
/* check that there is enough data */
if (size != vtrk_SIZE) {
diff --git a/libavformat/aiffdec.c b/libavformat/aiffdec.c
index 66f8eefc75..e33bd57b7f 100644
--- a/libavformat/aiffdec.c
+++ b/libavformat/aiffdec.c
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/mathematics.h"
#include "libavutil/dict.h"
#include "avformat.h"
#include "internal.h"
@@ -90,7 +90,8 @@ static void get_meta(AVFormatContext *s, const char *key, int size)
static unsigned int get_aiff_header(AVIOContext *pb, AVCodecContext *codec,
int size, unsigned version)
{
- AVExtFloat ext;
+ int exp;
+ uint64_t val;
double sample_rate;
unsigned int num_frames;
@@ -101,8 +102,9 @@ static unsigned int get_aiff_header(AVIOContext *pb, AVCodecContext *codec,
num_frames = avio_rb32(pb);
codec->bits_per_coded_sample = avio_rb16(pb);
- avio_read(pb, (uint8_t*)&ext, sizeof(ext));/* Sample rate is in */
- sample_rate = av_ext2dbl(ext); /* 80 bits BE IEEE extended float */
+ exp = avio_rb16(pb);
+ val = avio_rb64(pb);
+ sample_rate = ldexp(val, exp - 16383 - 63);
codec->sample_rate = sample_rate;
size -= 18;
diff --git a/libavformat/aiffenc.c b/libavformat/aiffenc.c
index 9a4f41b3f3..e5c38b1547 100644
--- a/libavformat/aiffenc.c
+++ b/libavformat/aiffenc.c
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
#include "avformat.h"
#include "internal.h"
#include "aiff.h"
@@ -37,7 +37,7 @@ static int aiff_write_header(AVFormatContext *s)
AIFFOutputContext *aiff = s->priv_data;
AVIOContext *pb = s->pb;
AVCodecContext *enc = s->streams[0]->codec;
- AVExtFloat sample_rate;
+ uint64_t sample_rate;
int aifc = 0;
/* First verify if format is ok */
@@ -89,8 +89,9 @@ static int aiff_write_header(AVFormatContext *s)
avio_wb16(pb, enc->bits_per_coded_sample); /* Sample size */
- sample_rate = av_dbl2ext((double)enc->sample_rate);
- avio_write(pb, (uint8_t*)&sample_rate, sizeof(sample_rate));
+ sample_rate = av_double2int(enc->sample_rate);
+ avio_wb16(pb, (sample_rate >> 52) + (16383 - 1023));
+ avio_wb64(pb, UINT64_C(1) << 63 | sample_rate << 11);
if (aifc) {
avio_wl32(pb, enc->codec_tag);
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 1f3506d158..340965955f 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -697,7 +697,8 @@ typedef struct AVStream {
/**
* last packet in packet_buffer for this stream when muxing.
- * used internally, NOT PART OF PUBLIC API, dont read or write from outside of libav*
+ * Used internally, NOT PART OF PUBLIC API, do not read or
+ * write from outside of libav*
*/
struct AVPacketList *last_in_packet_buffer;
#endif
@@ -731,7 +732,7 @@ typedef struct AVStream {
int64_t interleaver_chunk_duration;
/**
- * Stream informations used internally by av_find_stream_info()
+ * Stream information used internally by av_find_stream_info()
*/
#define MAX_STD_TIMEBASES (60*12+5)
struct {
@@ -909,7 +910,7 @@ typedef struct AVFormatContext {
/**
* Decoding: duration of the stream, in AV_TIME_BASE fractional
* seconds. Only set this value if you know none of the individual stream
- * durations and also dont set any of them. This is deduced from the
+ * durations and also do not set any of them. This is deduced from the
* AVStream values if not set.
*/
int64_t duration;
diff --git a/libavformat/cafdec.c b/libavformat/cafdec.c
index 89b2bd3883..3294f0639e 100644
--- a/libavformat/cafdec.c
+++ b/libavformat/cafdec.c
@@ -30,7 +30,7 @@
#include "riff.h"
#include "isom.h"
#include "libavutil/intreadwrite.h"
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
#include "libavutil/dict.h"
#include "caf.h"
@@ -68,7 +68,7 @@ static int read_desc_chunk(AVFormatContext *s)
/* parse format description */
st->codec->codec_type = AVMEDIA_TYPE_AUDIO;
- st->codec->sample_rate = av_int2dbl(avio_rb64(pb));
+ st->codec->sample_rate = av_int2double(avio_rb64(pb));
st->codec->codec_tag = avio_rl32(pb);
flags = avio_rb32(pb);
caf->bytes_per_packet = avio_rb32(pb);
diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c
index 86e31cc0af..2b7ae7ed35 100644
--- a/libavformat/ffmdec.c
+++ b/libavformat/ffmdec.c
@@ -20,7 +20,7 @@
*/
#include "libavutil/intreadwrite.h"
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
#include "avformat.h"
#include "internal.h"
#include "ffm.h"
@@ -329,10 +329,10 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap)
codec->rc_max_rate = avio_rb32(pb);
codec->rc_min_rate = avio_rb32(pb);
codec->rc_buffer_size = avio_rb32(pb);
- codec->i_quant_factor = av_int2dbl(avio_rb64(pb));
- codec->b_quant_factor = av_int2dbl(avio_rb64(pb));
- codec->i_quant_offset = av_int2dbl(avio_rb64(pb));
- codec->b_quant_offset = av_int2dbl(avio_rb64(pb));
+ codec->i_quant_factor = av_int2double(avio_rb64(pb));
+ codec->b_quant_factor = av_int2double(avio_rb64(pb));
+ codec->i_quant_offset = av_int2double(avio_rb64(pb));
+ codec->b_quant_offset = av_int2double(avio_rb64(pb));
codec->dct_algo = avio_rb32(pb);
codec->strict_std_compliance = avio_rb32(pb);
codec->max_b_frames = avio_rb32(pb);
@@ -344,7 +344,7 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap)
codec->mb_decision = avio_rb32(pb);
codec->nsse_weight = avio_rb32(pb);
codec->frame_skip_cmp = avio_rb32(pb);
- codec->rc_buffer_aggressivity = av_int2dbl(avio_rb64(pb));
+ codec->rc_buffer_aggressivity = av_int2double(avio_rb64(pb));
codec->codec_tag = avio_rb32(pb);
codec->thread_count = avio_r8(pb);
codec->coder_type = avio_rb32(pb);
@@ -355,8 +355,8 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap)
codec->keyint_min = avio_rb32(pb);
codec->scenechange_threshold = avio_rb32(pb);
codec->b_frame_strategy = avio_rb32(pb);
- codec->qcompress = av_int2dbl(avio_rb64(pb));
- codec->qblur = av_int2dbl(avio_rb64(pb));
+ codec->qcompress = av_int2double(avio_rb64(pb));
+ codec->qblur = av_int2double(avio_rb64(pb));
codec->max_qdiff = avio_rb32(pb);
codec->refs = avio_rb32(pb);
codec->directpred = avio_rb32(pb);
diff --git a/libavformat/ffmenc.c b/libavformat/ffmenc.c
index 1f65cac017..7378808567 100644
--- a/libavformat/ffmenc.c
+++ b/libavformat/ffmenc.c
@@ -20,7 +20,7 @@
*/
#include "libavutil/intreadwrite.h"
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
#include "avformat.h"
#include "internal.h"
#include "ffm.h"
@@ -137,10 +137,10 @@ static int ffm_write_header(AVFormatContext *s)
avio_wb32(pb, codec->rc_max_rate);
avio_wb32(pb, codec->rc_min_rate);
avio_wb32(pb, codec->rc_buffer_size);
- avio_wb64(pb, av_dbl2int(codec->i_quant_factor));
- avio_wb64(pb, av_dbl2int(codec->b_quant_factor));
- avio_wb64(pb, av_dbl2int(codec->i_quant_offset));
- avio_wb64(pb, av_dbl2int(codec->b_quant_offset));
+ avio_wb64(pb, av_double2int(codec->i_quant_factor));
+ avio_wb64(pb, av_double2int(codec->b_quant_factor));
+ avio_wb64(pb, av_double2int(codec->i_quant_offset));
+ avio_wb64(pb, av_double2int(codec->b_quant_offset));
avio_wb32(pb, codec->dct_algo);
avio_wb32(pb, codec->strict_std_compliance);
avio_wb32(pb, codec->max_b_frames);
@@ -152,7 +152,7 @@ static int ffm_write_header(AVFormatContext *s)
avio_wb32(pb, codec->mb_decision);
avio_wb32(pb, codec->nsse_weight);
avio_wb32(pb, codec->frame_skip_cmp);
- avio_wb64(pb, av_dbl2int(codec->rc_buffer_aggressivity));
+ avio_wb64(pb, av_double2int(codec->rc_buffer_aggressivity));
avio_wb32(pb, codec->codec_tag);
avio_w8(pb, codec->thread_count);
avio_wb32(pb, codec->coder_type);
@@ -163,8 +163,8 @@ static int ffm_write_header(AVFormatContext *s)
avio_wb32(pb, codec->keyint_min);
avio_wb32(pb, codec->scenechange_threshold);
avio_wb32(pb, codec->b_frame_strategy);
- avio_wb64(pb, av_dbl2int(codec->qcompress));
- avio_wb64(pb, av_dbl2int(codec->qblur));
+ avio_wb64(pb, av_double2int(codec->qcompress));
+ avio_wb64(pb, av_double2int(codec->qblur));
avio_wb32(pb, codec->max_qdiff);
avio_wb32(pb, codec->refs);
avio_wb32(pb, codec->directpred);
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index 0699f544b5..34945299b6 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -26,7 +26,7 @@
#include "libavutil/avstring.h"
#include "libavutil/dict.h"
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
#include "libavutil/mathematics.h"
#include "libavcodec/bytestream.h"
#include "libavcodec/mpeg4audio.h"
@@ -187,7 +187,7 @@ static int parse_keyframes_index(AVFormatContext *s, AVIOContext *ioc, AVStream
for (i = 0; i < arraylen && avio_tell(ioc) < max_pos - 1; i++) {
if (avio_r8(ioc) != AMF_DATA_TYPE_NUMBER)
goto finish;
- current_array[0][i] = av_int2dbl(avio_rb64(ioc));
+ current_array[0][i] = av_int2double(avio_rb64(ioc));
}
if (times && filepositions) {
// All done, exiting at a position allowing amf_parse_object
@@ -224,7 +224,7 @@ static int amf_parse_object(AVFormatContext *s, AVStream *astream, AVStream *vst
switch(amf_type) {
case AMF_DATA_TYPE_NUMBER:
- num_val = av_int2dbl(avio_rb64(ioc)); break;
+ num_val = av_int2double(avio_rb64(ioc)); break;
case AMF_DATA_TYPE_BOOL:
num_val = avio_r8(ioc); break;
case AMF_DATA_TYPE_STRING:
diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index 2a223eeeb3..2384e81276 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -20,7 +20,7 @@
*/
#include "libavutil/intreadwrite.h"
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
#include "avformat.h"
#include "flv.h"
#include "internal.h"
@@ -165,7 +165,7 @@ static void put_avc_eos_tag(AVIOContext *pb, unsigned ts) {
static void put_amf_double(AVIOContext *pb, double d)
{
avio_w8(pb, AMF_DATA_TYPE_NUMBER);
- avio_wb64(pb, av_dbl2int(d));
+ avio_wb64(pb, av_double2int(d));
}
static void put_amf_bool(AVIOContext *pb, int b) {
@@ -380,7 +380,7 @@ static int flv_write_trailer(AVFormatContext *s)
file_size = avio_tell(pb);
- /* update informations */
+ /* update information */
avio_seek(pb, flv->duration_offset, SEEK_SET);
put_amf_double(pb, flv->duration / (double)1000);
avio_seek(pb, flv->filesize_offset, SEEK_SET);
diff --git a/libavformat/gxfenc.c b/libavformat/gxfenc.c
index 02047c68d5..47b64efc9f 100644
--- a/libavformat/gxfenc.c
+++ b/libavformat/gxfenc.c
@@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
#include "libavutil/opt.h"
#include "libavutil/mathematics.h"
#include "libavcodec/timecode.h"
@@ -551,8 +551,8 @@ static int gxf_write_umf_media_dv(AVIOContext *pb, GXFStreamContext *sc)
static int gxf_write_umf_media_audio(AVIOContext *pb, GXFStreamContext *sc)
{
- avio_wl64(pb, av_dbl2int(1)); /* sound level to begin to */
- avio_wl64(pb, av_dbl2int(1)); /* sound level to begin to */
+ avio_wl64(pb, av_double2int(1)); /* sound level to begin to */
+ avio_wl64(pb, av_double2int(1)); /* sound level to begin to */
avio_wl32(pb, 0); /* number of fields over which to ramp up sound level */
avio_wl32(pb, 0); /* number of fields over which to ramp down sound level */
avio_wl32(pb, 0); /* reserved */
diff --git a/libavformat/http.c b/libavformat/http.c
index f7e0b5cc8c..5d19c6e007 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -70,7 +70,7 @@ static const AVClass flavor ## _context_class = {\
.item_name = av_default_item_name,\
.option = options,\
.version = LIBAVUTIL_VERSION_INT,\
-};
+}
HTTP_CLASS(http);
HTTP_CLASS(https);
diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c
index f0a21977ef..37143b53ad 100644
--- a/libavformat/id3v2.c
+++ b/libavformat/id3v2.c
@@ -149,7 +149,7 @@ static void free_geobtag(void *obj)
* @param maxread Pointer to maximum number of characters to read from the
* AVIOContext. After execution the value is decremented by the number of bytes
* actually read.
- * @returns 0 if no error occured, dst is uninitialized on error
+ * @returns 0 if no error occurred, dst is uninitialized on error
*/
static int decode_str(AVFormatContext *s, AVIOContext *pb, int encoding,
uint8_t **dst, int *maxread)
diff --git a/libavformat/img2.c b/libavformat/img2.c
index 98397f4dcb..bc35591a0b 100644
--- a/libavformat/img2.c
+++ b/libavformat/img2.c
@@ -446,7 +446,7 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
(!st->codec->extradata_size &&
AV_RL32(pkt->data+4) != MKTAG('j','P',' ',' '))){ // signature
error:
- av_log(s, AV_LOG_ERROR, "malformated jpeg2000 codestream %X\n", AV_RB32(pkt->data));
+ av_log(s, AV_LOG_ERROR, "malformed JPEG 2000 codestream %X\n", AV_RB32(pkt->data));
return -1;
}
}
diff --git a/libavformat/iv8.c b/libavformat/iv8.c
index b1b40929a3..fa77f82471 100644
--- a/libavformat/iv8.c
+++ b/libavformat/iv8.c
@@ -24,7 +24,7 @@
static int probe(AVProbeData *p)
{
- // the single file i have starts with that, i dont know if others do too
+ // the single file I have starts with that, I do not know if others do, too
if( p->buf[0] == 1
&& p->buf[1] == 1
&& p->buf[2] == 3
diff --git a/libavformat/matroskadec.c b/libavformat/matroskadec.c
index 4a0c2fa76c..fd1001ef8e 100644
--- a/libavformat/matroskadec.c
+++ b/libavformat/matroskadec.c
@@ -38,7 +38,7 @@
#include "rm.h"
#include "matroska.h"
#include "libavcodec/mpeg4audio.h"
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
#include "libavutil/intreadwrite.h"
#include "libavutil/avstring.h"
#include "libavutil/lzo.h"
@@ -652,9 +652,9 @@ static int ebml_read_float(AVIOContext *pb, int size, double *num)
if (size == 0) {
*num = 0;
} else if (size == 4) {
- *num= av_int2flt(avio_rb32(pb));
- } else if(size==8){
- *num= av_int2dbl(avio_rb64(pb));
+ *num = av_int2float(avio_rb32(pb));
+ } else if (size == 8){
+ *num = av_int2double(avio_rb64(pb));
} else
return AVERROR_INVALIDDATA;
diff --git a/libavformat/matroskaenc.c b/libavformat/matroskaenc.c
index b8c4667a4e..e74366fe95 100644
--- a/libavformat/matroskaenc.c
+++ b/libavformat/matroskaenc.c
@@ -29,7 +29,7 @@
#include "avlanguage.h"
#include "libavutil/samplefmt.h"
#include "libavutil/intreadwrite.h"
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
#include "libavutil/mathematics.h"
#include "libavutil/random_seed.h"
#include "libavutil/lfg.h"
@@ -185,7 +185,7 @@ static void put_ebml_float(AVIOContext *pb, unsigned int elementid, double val)
{
put_ebml_id(pb, elementid);
put_ebml_num(pb, 8, 0);
- avio_wb64(pb, av_dbl2int(val));
+ avio_wb64(pb, av_double2int(val));
}
static void put_ebml_binary(AVIOContext *pb, unsigned int elementid,
diff --git a/libavformat/mms.h b/libavformat/mms.h
index 0117089d24..cbfa79a838 100644
--- a/libavformat/mms.h
+++ b/libavformat/mms.h
@@ -33,7 +33,7 @@ typedef struct {
/** Buffer for outgoing packets. */
/*@{*/
- uint8_t *write_out_ptr; ///< Pointer for writting the buffer.
+ uint8_t *write_out_ptr; ///< Pointer for writing the buffer.
uint8_t out_buffer[512]; ///< Buffer for outgoing packet.
/*@}*/
diff --git a/libavformat/mov.c b/libavformat/mov.c
index 12af19ed50..7b41ec4414 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -26,7 +26,7 @@
//#define MOV_EXPORT_ALL_METADATA
#include "libavutil/intreadwrite.h"
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
#include "libavutil/mathematics.h"
#include "libavutil/avstring.h"
#include "libavutil/dict.h"
@@ -1261,7 +1261,7 @@ int ff_mov_read_stsd_entries(MOVContext *c, AVIOContext *pb, int entries)
avio_rb32(pb); /* bytes per sample */
} else if (version==2) {
avio_rb32(pb); /* sizeof struct only */
- st->codec->sample_rate = av_int2dbl(avio_rb64(pb)); /* float 64 */
+ st->codec->sample_rate = av_int2double(avio_rb64(pb)); /* float 64 */
st->codec->channels = avio_rb32(pb);
avio_rb32(pb); /* always 0x7F000000 */
st->codec->bits_per_coded_sample = avio_rb32(pb); /* bits per channel if sound is uncompressed */
diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 181965f720..610a1fcff3 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -32,7 +32,7 @@
#include "libavcodec/put_bits.h"
#include "internal.h"
#include "libavutil/avstring.h"
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "libavutil/dict.h"
@@ -250,7 +250,7 @@ static int mov_write_ac3_tag(AVIOContext *pb, MOVTrack *track)
/**
* This function writes extradata "as is".
- * Extradata must be formated like a valid atom (with size and tag)
+ * Extradata must be formatted like a valid atom (with size and tag).
*/
static int mov_write_extradata_tag(AVIOContext *pb, MOVTrack *track)
{
@@ -484,7 +484,7 @@ static int mov_write_audio_tag(AVIOContext *pb, MOVTrack *track)
avio_wb16(pb, 0);
avio_wb32(pb, 0x00010000);
avio_wb32(pb, 72);
- avio_wb64(pb, av_dbl2int(track->timescale));
+ avio_wb64(pb, av_double2int(track->timescale));
avio_wb32(pb, track->enc->channels);
avio_wb32(pb, 0x7F000000);
avio_wb32(pb, av_get_bits_per_sample(track->enc->codec_id));
@@ -1302,7 +1302,7 @@ static int mov_write_tapt_tag(AVIOContext *pb, MOVTrack *track)
avio_wb32(pb, track->enc->height << 16);
return updateSize(pb, pos);
-};
+}
// This box seems important for the psp playback ... without it the movie seems to hang
static int mov_write_edts_tag(AVIOContext *pb, MOVTrack *track)
@@ -2206,6 +2206,7 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
AVCodecContext *enc = trk->enc;
unsigned int samplesInChunk = 0;
int size= pkt->size;
+ uint8_t *reformatted_data = NULL;
if (!s->pb->seekable) return 0; /* Can't handle that */
if (!size) return 0; /* Discard 0 sized packets */
@@ -2255,13 +2256,23 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
if(mov->frag_seq_num>0){
uint8_t *buf=NULL;
size= pkt->size;
+
if(ff_avc_parse_nal_units_buf(pkt->data, &buf, &size) < 0){
av_log(s, AV_LOG_ERROR, "malformated H264 bitstream\n");
return -1;
}
trk->cluster[trk->entry].data= buf;
- }else
+ if (trk->hint_track >= 0 && trk->hint_track < mov->nb_streams) {
+ reformatted_data= av_malloc(size);
+ memcpy(reformatted_data, buf, size);
+ }
+ }else if (trk->hint_track >= 0 && trk->hint_track < mov->nb_streams) {
+ ff_avc_parse_nal_units_buf(pkt->data, &reformatted_data,
+ &size);
+ avio_write(pb, reformatted_data, size);
+ } else {
size = ff_avc_parse_nal_units(pb, pkt->data, pkt->size);
+ }
} else if (enc->codec_id == CODEC_ID_AAC && pkt->size > 2 &&
(AV_RB16(pkt->data) & 0xfff0) == 0xfff0) {
av_log(s, AV_LOG_ERROR, "malformated aac bitstream, use -absf aac_adtstoasc\n");
@@ -2320,7 +2331,9 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
avio_flush(pb);
if (trk->hint_track >= 0 && trk->hint_track < mov->nb_streams)
- ff_mov_add_hinted_packet(s, pkt, trk->hint_track, trk->entry);
+ ff_mov_add_hinted_packet(s, pkt, trk->hint_track, trk->entry,
+ reformatted_data, size);
+ av_free(reformatted_data);
return 0;
}
diff --git a/libavformat/movenc.h b/libavformat/movenc.h
index e0ed6e6516..356421c7db 100644
--- a/libavformat/movenc.h
+++ b/libavformat/movenc.h
@@ -131,7 +131,8 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt);
int ff_mov_init_hinting(AVFormatContext *s, int index, int src_index);
int ff_mov_add_hinted_packet(AVFormatContext *s, AVPacket *pkt,
- int track_index, int sample);
+ int track_index, int sample,
+ uint8_t *sample_data, int sample_size);
void ff_mov_close_hinting(MOVTrack *track);
#endif /* AVFORMAT_MOVENC_H */
diff --git a/libavformat/movenchint.c b/libavformat/movenchint.c
index 8e96355abc..bb55f73053 100644
--- a/libavformat/movenchint.c
+++ b/libavformat/movenchint.c
@@ -95,11 +95,12 @@ static void sample_queue_free(HintSampleQueue *queue)
* not copied. sample_queue_retain should be called before pkt->data
* is reused/freed.
*/
-static void sample_queue_push(HintSampleQueue *queue, AVPacket *pkt, int sample)
+static void sample_queue_push(HintSampleQueue *queue, uint8_t *data, int size,
+ int sample)
{
/* No need to keep track of smaller samples, since describing them
* with immediates is more efficient. */
- if (pkt->size <= 14)
+ if (size <= 14)
return;
if (!queue->samples || queue->len >= queue->size) {
HintSample* samples;
@@ -109,8 +110,8 @@ static void sample_queue_push(HintSampleQueue *queue, AVPacket *pkt, int sample)
return;
queue->samples = samples;
}
- queue->samples[queue->len].data = pkt->data;
- queue->samples[queue->len].size = pkt->size;
+ queue->samples[queue->len].data = data;
+ queue->samples[queue->len].size = size;
queue->samples[queue->len].sample_number = sample;
queue->samples[queue->len].offset = 0;
queue->samples[queue->len].own_data = 0;
@@ -386,7 +387,8 @@ static int write_hint_packets(AVIOContext *out, const uint8_t *data,
}
int ff_mov_add_hinted_packet(AVFormatContext *s, AVPacket *pkt,
- int track_index, int sample)
+ int track_index, int sample,
+ uint8_t *sample_data, int sample_size)
{
MOVMuxContext *mov = s->priv_data;
MOVTrack *trk = &mov->tracks[track_index];
@@ -402,7 +404,10 @@ int ff_mov_add_hinted_packet(AVFormatContext *s, AVPacket *pkt,
if (!rtp_ctx->pb)
return AVERROR(ENOMEM);
- sample_queue_push(&trk->sample_queue, pkt, sample);
+ if (sample_data)
+ sample_queue_push(&trk->sample_queue, sample_data, sample_size, sample);
+ else
+ sample_queue_push(&trk->sample_queue, pkt->data, pkt->size, sample);
/* Feed the packet to the RTP muxer */
ff_write_chained(rtp_ctx, 0, pkt, s);
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 8d026fd372..a8871cc576 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -1939,7 +1939,7 @@ static int mpegts_read_header(AVFormatContext *s,
if (s->iformat == &ff_mpegts_demuxer) {
/* normal demux */
- /* first do a scanning to get all the services */
+ /* first do a scan to get all the services */
/* NOTE: We attempt to seek on non-seekable files as well, as the
* probe buffer usually is big enough. Only warn if the seek failed
* on files where the seek should work. */
diff --git a/libavformat/mpegtsenc.c b/libavformat/mpegtsenc.c
index b75eff73c0..3ace64bdd5 100644
--- a/libavformat/mpegtsenc.c
+++ b/libavformat/mpegtsenc.c
@@ -979,7 +979,7 @@ static int mpegts_write_packet(AVFormatContext *s, AVPacket *pkt)
uint32_t state = -1;
if (pkt->size < 5 || AV_RB32(pkt->data) != 0x0000001) {
- av_log(s, AV_LOG_ERROR, "h264 bitstream malformated, "
+ av_log(s, AV_LOG_ERROR, "H.264 bitstream malformed, "
"no startcode found, use -vbsf h264_mp4toannexb\n");
return -1;
}
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index 0b62a5a851..c209c5c5e5 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -70,7 +70,7 @@ typedef struct {
int index; ///< index in mxf_essence_container_uls table
const UID *codec_ul;
int order; ///< interleaving order if dts are equal
- int interlaced; ///< wether picture is interlaced
+ int interlaced; ///< whether picture is interlaced
int temporal_reordering;
AVRational aspect_ratio; ///< display aspect ratio
int closed_gop; ///< gop is closed, used in mpeg-2 frame parsing
diff --git a/libavformat/nuv.c b/libavformat/nuv.c
index c421ca98f4..93cbc264c3 100644
--- a/libavformat/nuv.c
+++ b/libavformat/nuv.c
@@ -20,7 +20,7 @@
*/
#include "libavutil/intreadwrite.h"
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
#include "avformat.h"
#include "internal.h"
#include "riff.h"
@@ -140,10 +140,10 @@ static int nuv_header(AVFormatContext *s, AVFormatParameters *ap) {
avio_rl32(pb); // unused, "desiredheight"
avio_r8(pb); // 'P' == progressive, 'I' == interlaced
avio_skip(pb, 3); // padding
- aspect = av_int2dbl(avio_rl64(pb));
+ aspect = av_int2double(avio_rl64(pb));
if (aspect > 0.9999 && aspect < 1.0001)
aspect = 4.0 / 3.0;
- fps = av_int2dbl(avio_rl64(pb));
+ fps = av_int2double(avio_rl64(pb));
// number of packets per stream type, -1 means unknown, e.g. streaming
v_packs = avio_rl32(pb);
diff --git a/libavformat/rdt.c b/libavformat/rdt.c
index 947ba80b54..a367ab1265 100644
--- a/libavformat/rdt.c
+++ b/libavformat/rdt.c
@@ -484,7 +484,7 @@ real_parse_asm_rulebook(AVFormatContext *s, AVStream *orig_st,
* is set and once for if it isn't. We only read the first because we
* don't care much (that's what the "odd" variable is for).
* Each rule contains a set of one or more statements, optionally
- * preceeded by a single condition. If there's a condition, the rule
+ * preceded by a single condition. If there's a condition, the rule
* starts with a '#'. Multiple conditions are merged between brackets,
* so there are never multiple conditions spread out over separate
* statements. Generally, these conditions are bitrate limits (min/max)
diff --git a/libavformat/rtmppkt.c b/libavformat/rtmppkt.c
index 7e2ccdc6ac..61e159b06a 100644
--- a/libavformat/rtmppkt.c
+++ b/libavformat/rtmppkt.c
@@ -21,7 +21,7 @@
#include "libavcodec/bytestream.h"
#include "libavutil/avstring.h"
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
#include "avformat.h"
#include "rtmppkt.h"
@@ -37,7 +37,7 @@ void ff_amf_write_bool(uint8_t **dst, int val)
void ff_amf_write_number(uint8_t **dst, double val)
{
bytestream_put_byte(dst, AMF_DATA_TYPE_NUMBER);
- bytestream_put_be64(dst, av_dbl2int(val));
+ bytestream_put_be64(dst, av_double2int(val));
}
void ff_amf_write_string(uint8_t **dst, const char *str)
@@ -318,7 +318,7 @@ int ff_amf_get_field_value(const uint8_t *data, const uint8_t *data_end,
if (size == namelen && !memcmp(data-size, name, namelen)) {
switch (*data++) {
case AMF_DATA_TYPE_NUMBER:
- snprintf(dst, dst_size, "%g", av_int2dbl(AV_RB64(data)));
+ snprintf(dst, dst_size, "%g", av_int2double(AV_RB64(data)));
break;
case AMF_DATA_TYPE_BOOL:
snprintf(dst, dst_size, "%s", *data ? "true" : "false");
@@ -370,7 +370,7 @@ static void ff_amf_tag_contents(void *ctx, const uint8_t *data, const uint8_t *d
return;
switch (*data++) {
case AMF_DATA_TYPE_NUMBER:
- av_log(ctx, AV_LOG_DEBUG, " number %g\n", av_int2dbl(AV_RB64(data)));
+ av_log(ctx, AV_LOG_DEBUG, " number %g\n", av_int2double(AV_RB64(data)));
return;
case AMF_DATA_TYPE_BOOL:
av_log(ctx, AV_LOG_DEBUG, " bool %d\n", *data);
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c
index 8aec9f32ce..4fe1d33274 100644
--- a/libavformat/rtmpproto.c
+++ b/libavformat/rtmpproto.c
@@ -26,7 +26,7 @@
#include "libavcodec/bytestream.h"
#include "libavutil/avstring.h"
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
#include "libavutil/lfg.h"
#include "libavutil/sha.h"
#include "avformat.h"
@@ -615,7 +615,7 @@ static int rtmp_parse_result(URLContext *s, RTMPContext *rt, RTMPPacket *pkt)
/* hack for Wowza Media Server, it does not send result for
* releaseStream and FCPublish calls */
if (!pkt->data[10]) {
- int pkt_id = (int) av_int2dbl(AV_RB64(pkt->data + 11));
+ int pkt_id = av_int2double(AV_RB64(pkt->data + 11));
if (pkt_id == rt->create_stream_invoke)
rt->state = STATE_CONNECTING;
}
@@ -626,7 +626,7 @@ static int rtmp_parse_result(URLContext *s, RTMPContext *rt, RTMPPacket *pkt)
if (pkt->data[10] || pkt->data[19] != 5 || pkt->data[20]) {
av_log(s, AV_LOG_WARNING, "Unexpected reply on connect()\n");
} else {
- rt->main_channel_id = (int) av_int2dbl(AV_RB64(pkt->data + 21));
+ rt->main_channel_id = av_int2double(AV_RB64(pkt->data + 21));
}
if (rt->is_input) {
gen_play(s, rt);
diff --git a/libavformat/rtp.h b/libavformat/rtp.h
index 5297e17f6a..23588755ec 100644
--- a/libavformat/rtp.h
+++ b/libavformat/rtp.h
@@ -72,7 +72,7 @@ enum CodecID ff_rtp_codec_id(const char *buf, enum AVMediaType codec_type);
#define RTP_VERSION 2
#define RTP_MAX_SDES 256 /**< maximum text length for SDES */
-/* RTCP paquets use 0.5 % of the bandwidth */
+/* RTCP packets use 0.5% of the bandwidth */
#define RTCP_TX_RATIO_NUM 5
#define RTCP_TX_RATIO_DEN 1000
diff --git a/libavformat/rtpenc_h264.c b/libavformat/rtpenc_h264.c
index 11074d0d51..86930bbac1 100644
--- a/libavformat/rtpenc_h264.c
+++ b/libavformat/rtpenc_h264.c
@@ -33,18 +33,15 @@ static const uint8_t *avc_mp4_find_startcode(const uint8_t *start, const uint8_t
{
int res = 0;
- if (end - start < nal_length_size) {
+ if (end - start < nal_length_size)
return NULL;
- }
- while (nal_length_size--) {
+ while (nal_length_size--)
res = (res << 8) | *start++;
- }
- if (end - start < res) {
+ if (start + res > end || res < 0 || start + res < start)
return NULL;
- }
- return res + start;
+ return start + res;
}
static void nal_send(AVFormatContext *s1, const uint8_t *buf, int size, int last)
@@ -80,25 +77,27 @@ static void nal_send(AVFormatContext *s1, const uint8_t *buf, int size, int last
void ff_rtp_send_h264(AVFormatContext *s1, const uint8_t *buf1, int size)
{
- const uint8_t *r;
+ const uint8_t *r, *end = buf1 + size;
RTPMuxContext *s = s1->priv_data;
s->timestamp = s->cur_timestamp;
- r = s->nal_length_size ? (avc_mp4_find_startcode(buf1, buf1 + size, s->nal_length_size) ? buf1 : buf1 + size) : ff_avc_find_startcode(buf1, buf1 + size);
- while (r < buf1 + size) {
+ if (s->nal_length_size)
+ r = avc_mp4_find_startcode(buf1, end, s->nal_length_size) ? buf1 : end;
+ else
+ r = ff_avc_find_startcode(buf1, end);
+ while (r < end) {
const uint8_t *r1;
if (s->nal_length_size) {
- r1 = avc_mp4_find_startcode(r, buf1 + size, s->nal_length_size);
- if (!r1) {
- r1 = buf1 + size;
- }
+ r1 = avc_mp4_find_startcode(r, end, s->nal_length_size);
+ if (!r1)
+ r1 = end;
r += s->nal_length_size;
} else {
- while(!*(r++));
- r1 = ff_avc_find_startcode(r, buf1 + size);
+ while (!*(r++));
+ r1 = ff_avc_find_startcode(r, end);
}
- nal_send(s1, r, r1 - r, (r1 == buf1 + size));
+ nal_send(s1, r, r1 - r, r1 == end);
r = r1;
}
}
diff --git a/libavformat/sdp.c b/libavformat/sdp.c
index 5def15d2a3..11b50a0d07 100644
--- a/libavformat/sdp.c
+++ b/libavformat/sdp.c
@@ -156,6 +156,8 @@ static char *extradata2psets(AVCodecContext *c)
char *psets, *p;
const uint8_t *r;
const char *pset_string = "; sprop-parameter-sets=";
+ uint8_t *orig_extradata = NULL;
+ int orig_extradata_size = 0;
if (c->extradata_size > MAX_EXTRADATA_SIZE) {
av_log(c, AV_LOG_ERROR, "Too much extradata!\n");
@@ -172,6 +174,15 @@ static char *extradata2psets(AVCodecContext *c)
return NULL;
}
+
+ orig_extradata_size = c->extradata_size;
+ orig_extradata = av_mallocz(orig_extradata_size +
+ FF_INPUT_BUFFER_PADDING_SIZE);
+ if (!orig_extradata) {
+ av_bitstream_filter_close(bsfc);
+ return NULL;
+ }
+ memcpy(orig_extradata, c->extradata, orig_extradata_size);
av_bitstream_filter_filter(bsfc, c, NULL, &dummy_p, &dummy_int, NULL, 0, 0);
av_bitstream_filter_close(bsfc);
}
@@ -179,6 +190,7 @@ static char *extradata2psets(AVCodecContext *c)
psets = av_mallocz(MAX_PSET_SIZE);
if (psets == NULL) {
av_log(c, AV_LOG_ERROR, "Cannot allocate memory for the parameter sets.\n");
+ av_free(orig_extradata);
return NULL;
}
memcpy(psets, pset_string, strlen(pset_string));
@@ -208,6 +220,11 @@ static char *extradata2psets(AVCodecContext *c)
p += strlen(p);
r = r1;
}
+ if (orig_extradata) {
+ av_free(c->extradata);
+ c->extradata = orig_extradata;
+ c->extradata_size = orig_extradata_size;
+ }
return psets;
}
diff --git a/libavformat/soxdec.c b/libavformat/soxdec.c
index 45607ec666..ad8f488961 100644
--- a/libavformat/soxdec.c
+++ b/libavformat/soxdec.c
@@ -30,7 +30,7 @@
*/
#include "libavutil/intreadwrite.h"
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
#include "libavutil/dict.h"
#include "avformat.h"
#include "internal.h"
@@ -62,14 +62,14 @@ static int sox_read_header(AVFormatContext *s,
st->codec->codec_id = CODEC_ID_PCM_S32LE;
header_size = avio_rl32(pb);
avio_skip(pb, 8); /* sample count */
- sample_rate = av_int2dbl(avio_rl64(pb));
+ sample_rate = av_int2double(avio_rl64(pb));
st->codec->channels = avio_rl32(pb);
comment_size = avio_rl32(pb);
} else {
st->codec->codec_id = CODEC_ID_PCM_S32BE;
header_size = avio_rb32(pb);
avio_skip(pb, 8); /* sample count */
- sample_rate = av_int2dbl(avio_rb64(pb));
+ sample_rate = av_int2double(avio_rb64(pb));
st->codec->channels = avio_rb32(pb);
comment_size = avio_rb32(pb);
}
diff --git a/libavformat/soxenc.c b/libavformat/soxenc.c
index a8549b0ffa..811cb0e97d 100644
--- a/libavformat/soxenc.c
+++ b/libavformat/soxenc.c
@@ -30,7 +30,7 @@
*/
#include "libavutil/intreadwrite.h"
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
#include "libavutil/dict.h"
#include "avformat.h"
#include "avio_internal.h"
@@ -59,14 +59,14 @@ static int sox_write_header(AVFormatContext *s)
ffio_wfourcc(pb, ".SoX");
avio_wl32(pb, sox->header_size);
avio_wl64(pb, 0); /* number of samples */
- avio_wl64(pb, av_dbl2int(enc->sample_rate));
+ avio_wl64(pb, av_double2int(enc->sample_rate));
avio_wl32(pb, enc->channels);
avio_wl32(pb, comment_size);
} else if (enc->codec_id == CODEC_ID_PCM_S32BE) {
ffio_wfourcc(pb, "XoS.");
avio_wb32(pb, sox->header_size);
avio_wb64(pb, 0); /* number of samples */
- avio_wb64(pb, av_dbl2int(enc->sample_rate));
+ avio_wb64(pb, av_double2int(enc->sample_rate));
avio_wb32(pb, enc->channels);
avio_wb32(pb, comment_size);
} else {
diff --git a/libavformat/thp.c b/libavformat/thp.c
index 96f9ba115c..cd50917105 100644
--- a/libavformat/thp.c
+++ b/libavformat/thp.c
@@ -20,7 +20,7 @@
*/
#include "libavutil/intreadwrite.h"
-#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/intfloat.h"
#include "avformat.h"
#include "internal.h"
@@ -69,7 +69,7 @@ static int thp_read_header(AVFormatContext *s,
avio_rb32(pb); /* Max buf size. */
avio_rb32(pb); /* Max samples. */
- thp->fps = av_d2q(av_int2flt(avio_rb32(pb)), INT_MAX);
+ thp->fps = av_d2q(av_int2float(avio_rb32(pb)), INT_MAX);
thp->framecnt = avio_rb32(pb);
thp->first_framesz = avio_rb32(pb);
avio_rb32(pb); /* Data size. */
diff --git a/libavformat/udp.c b/libavformat/udp.c
index a0d127c614..281f5158b3 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -452,7 +452,7 @@ static int udp_open(URLContext *h, const char *uri, int flags)
goto fail;
/* Follow the requested reuse option, unless it's multicast in which
- * case enable reuse unless explicitely disabled.
+ * case enable reuse unless explicitly disabled.
*/
if (s->reuse_socket || (s->is_multicast && !reuse_specified)) {
s->reuse_socket = 1;
diff --git a/libavformat/utils.c b/libavformat/utils.c
index 3e5a7b76dd..82cc99515a 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -1123,7 +1123,7 @@ static void compute_pkt_fields(AVFormatContext *s, AVStream *st,
FFSWAP(int64_t, st->pts_buffer[i], st->pts_buffer[i+1]);
if(pkt->dts == AV_NOPTS_VALUE)
pkt->dts= st->pts_buffer[0];
- if(st->codec->codec_id == CODEC_ID_H264){ //we skiped it above so we try here
+ if(st->codec->codec_id == CODEC_ID_H264){ // we skipped it above so we try here
update_initial_timestamps(s, pkt->stream_index, pkt->dts, pkt->pts); // this should happen on the first packet
}
if(pkt->dts > st->cur_dts)