* AIFF/AIFF-C demuxer
* Copyright (c) 2006 Patrick Guimond
*
- * This file is part of FFmpeg.
+ * This file is part of Libav.
*
- * FFmpeg is free software; you can redistribute it and/or
+ * Libav is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
- * FFmpeg is distributed in the hope that it will be useful,
+ * Libav is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with FFmpeg; if not, write to the Free Software
+ * License along with Libav; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "libavutil/intfloat_readwrite.h"
+#include "libavutil/dict.h"
#include "avformat.h"
#include "pcm.h"
#include "aiff.h"
int res;
if (!str) {
- avio_seek(s->pb, size, SEEK_CUR);
+ avio_skip(s->pb, size);
return;
}
return;
str[res] = 0;
- av_metadata_set2(&s->metadata, key, str, AV_METADATA_DONT_STRDUP_VAL);
+ av_dict_set(&s->metadata, key, str, AV_DICT_DONT_STRDUP_VAL);
}
/* Returns the number of sound data frames or negative on error */
/* Chunk is over */
if (size)
- avio_seek(pb, size, SEEK_CUR);
+ avio_skip(pb, size);
return num_frames;
}
filesize -= 4;
- st = av_new_stream(s, 0);
+ st = avformat_new_stream(s, NULL);
if (!st)
return AVERROR(ENOMEM);
offset += avio_tell(pb); /* Compute absolute data offset */
if (st->codec->block_align) /* Assume COMM already parsed */
goto got_sound;
- if (url_is_streamed(pb)) {
+ if (!pb->seekable) {
av_log(s, AV_LOG_ERROR, "file is not seekable\n");
return -1;
}
- avio_seek(pb, size - 8, SEEK_CUR);
+ avio_skip(pb, size - 8);
break;
case MKTAG('w', 'a', 'v', 'e'):
if ((uint64_t)size > (1<<30))
default: /* Jump */
if (size & 1) /* Always even aligned */
size++;
- avio_seek(pb, size, SEEK_CUR);
+ avio_skip(pb, size);
}
}
got_sound:
/* Now positioned, get the sound data start and end */
- if (st->nb_frames)
- s->file_size = st->nb_frames * st->codec->block_align;
-
av_set_pts_info(st, 64, 1, st->codec->sample_rate);
st->start_time = 0;
st->duration = st->codec->frame_size ?
}
AVInputFormat ff_aiff_demuxer = {
- "aiff",
- NULL_IF_CONFIG_SMALL("Audio IFF"),
- sizeof(AIFFInputContext),
- aiff_probe,
- aiff_read_header,
- aiff_read_packet,
- NULL,
- pcm_read_seek,
+ .name = "aiff",
+ .long_name = NULL_IF_CONFIG_SMALL("Audio IFF"),
+ .priv_data_size = sizeof(AIFFInputContext),
+ .read_probe = aiff_probe,
+ .read_header = aiff_read_header,
+ .read_packet = aiff_read_packet,
+ .read_seek = pcm_read_seek,
.codec_tag= (const AVCodecTag* const []){ff_codec_aiff_tags, 0},
};