summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavformat/flvdec.c3
-rw-r--r--libavformat/flvenc.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index e9578c2e49..0530335c29 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -275,10 +275,11 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
type = get_byte(&s->pb);
size = get_be24(&s->pb);
pts = get_be24(&s->pb);
+ pts |= get_byte(&s->pb) << 24;
// av_log(s, AV_LOG_DEBUG, "type:%d, size:%d, pts:%d\n", type, size, pts);
if (url_feof(&s->pb))
return AVERROR(EIO);
- url_fskip(&s->pb, 4); /* reserved */
+ url_fskip(&s->pb, 3); /* stream id, always 0 */
flags = 0;
if(size == 0)
diff --git a/libavformat/flvenc.c b/libavformat/flvenc.c
index 2adc303232..3901ba76b0 100644
--- a/libavformat/flvenc.c
+++ b/libavformat/flvenc.c
@@ -307,7 +307,8 @@ static int flv_write_packet(AVFormatContext *s, AVPacket *pkt)
put_be24(pb,size + flags_size);
put_be24(pb,pkt->pts);
- put_be32(pb,flv->reserved);
+ put_byte(pb,pkt->pts >> 24);
+ put_be24(pb,flv->reserved);
put_byte(pb,flags);
if (enc->codec_id == CODEC_ID_VP6)
put_byte(pb,0);