summaryrefslogtreecommitdiff
path: root/libavcodec/parser.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2006-10-30 02:19:55 +0000
committerMichael Niedermayer <michaelni@gmx.at>2006-10-30 02:19:55 +0000
commit498c544ad20be3e5ebf9c481cc239958399fba12 (patch)
tree286002226bf9acd609bf5a6ffecd33d19ac3362f /libavcodec/parser.c
parentc0d8052b501bb07ccc379f0967ffe9bb2c77e606 (diff)
dont set the sampling rate just because 1 mp3 packet header says so (fixes playback speed on some old mencoder generated avis which where then dumped to mp3)
Originally committed as revision 6837 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/parser.c')
-rw-r--r--libavcodec/parser.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/libavcodec/parser.c b/libavcodec/parser.c
index c82744bdff..6fabdf650a 100644
--- a/libavcodec/parser.c
+++ b/libavcodec/parser.c
@@ -666,11 +666,10 @@ static int mpegaudio_parse(AVCodecParserContext *s1,
}
if ((s->inbuf_ptr - s->inbuf) >= MPA_HEADER_SIZE) {
got_header:
- sr= avctx->sample_rate;
header = (s->inbuf[0] << 24) | (s->inbuf[1] << 16) |
(s->inbuf[2] << 8) | s->inbuf[3];
- ret = mpa_decode_header(avctx, header);
+ ret = mpa_decode_header(avctx, header, &sr);
if (ret < 0) {
s->header_count= -2;
/* no sync found : move by one byte (inefficient, but simple!) */
@@ -694,8 +693,8 @@ static int mpegaudio_parse(AVCodecParserContext *s1,
}
#endif
}
- if(s->header_count <= 0)
- avctx->sample_rate= sr; //FIXME ugly
+ if(s->header_count > 1)
+ avctx->sample_rate= sr;
}
} else
#if 0