Commit bc4984c7 authored by bcoudurier's avatar bcoudurier

check for negative dts value even if bitstream is already formated,

this fixes dts when stream copying.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@16526 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 342135b1
...@@ -340,13 +340,14 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt) ...@@ -340,13 +340,14 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
put_byte(pb, FLV_TAG_TYPE_AUDIO); put_byte(pb, FLV_TAG_TYPE_AUDIO);
} }
if (enc->codec_id == CODEC_ID_H264 && if (enc->codec_id == CODEC_ID_H264) {
/* check if extradata looks like mp4 formated */ /* check if extradata looks like mp4 formated */
enc->extradata_size > 0 && *(uint8_t*)enc->extradata != 1) { if (enc->extradata_size > 0 && *(uint8_t*)enc->extradata != 1) {
if (ff_avc_parse_nal_units(pkt->data, &pkt->data, &pkt->size) < 0) if (ff_avc_parse_nal_units(pkt->data, &pkt->data, &pkt->size) < 0)
return -1; return -1;
assert(pkt->size); assert(pkt->size);
size = pkt->size; size = pkt->size;
}
/* cast needed to get negative value */ /* cast needed to get negative value */
if (!flv->delay && pkt->dts < 0) if (!flv->delay && pkt->dts < 0)
flv->delay = -pkt->dts; flv->delay = -pkt->dts;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment