summaryrefslogtreecommitdiff
path: root/libavformat/wav.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-01-15 17:13:30 +0000
committerMichael Niedermayer <michaelni@gmx.at>2011-01-15 17:13:30 +0000
commit724b1f6a05dbbc75df70990469fe521b93a098de (patch)
tree366c28a09a59bac50459c3504c7ff5942dce8aa4 /libavformat/wav.c
parent925aa96915b8143017cb63418cb709b992c59065 (diff)
Factor tag reading code out of wav read_header()
Originally committed as revision 26369 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat/wav.c')
-rw-r--r--libavformat/wav.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libavformat/wav.c b/libavformat/wav.c
index 903bc72747..7cb242982a 100644
--- a/libavformat/wav.c
+++ b/libavformat/wav.c
@@ -140,6 +140,13 @@ AVOutputFormat wav_muxer = {
#if CONFIG_WAV_DEMUXER
+
+static int64_t next_tag(ByteIOContext *pb, unsigned int *tag)
+{
+ *tag = get_le32(pb);
+ return get_le32(pb);
+}
+
/* return the size of the found tag */
static int64_t find_tag(ByteIOContext *pb, uint32_t tag1)
{
@@ -149,8 +156,7 @@ static int64_t find_tag(ByteIOContext *pb, uint32_t tag1)
for (;;) {
if (url_feof(pb))
return -1;
- tag = get_le32(pb);
- size = get_le32(pb);
+ size = next_tag(pb, &tag);
if (tag == tag1)
break;
url_fseek(pb, size, SEEK_CUR);