summaryrefslogtreecommitdiff
path: root/libavformat/tmv.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/tmv.c')
-rw-r--r--libavformat/tmv.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/libavformat/tmv.c b/libavformat/tmv.c
index f894eab46a..03d6e08f0e 100644
--- a/libavformat/tmv.c
+++ b/libavformat/tmv.c
@@ -2,28 +2,28 @@
* 8088flex TMV file demuxer
* Copyright (c) 2009 Daniel Verkamp <daniel at drv.nu>
*
- * This file is part of Libav.
+ * This file is part of FFmpeg.
*
- * Libav is free software; you can redistribute it and/or
+ * FFmpeg 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.
*
- * Libav is distributed in the hope that it will be useful,
+ * FFmpeg 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 Libav; if not, write to the Free Software
+ * License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
/**
- * 8088flex TMV file demuxer
* @file
+ * 8088flex TMV file demuxer
* @author Daniel Verkamp
- * @sa http://www.oldskool.org/pc/8088_Corruption
+ * @see http://www.oldskool.org/pc/8088_Corruption
*/
#include "libavutil/intreadwrite.h"
@@ -73,10 +73,10 @@ static int tmv_read_header(AVFormatContext *s, AVFormatParameters *ap)
if (avio_rl32(pb) != TMV_TAG)
return -1;
- if (!(vst = av_new_stream(s, 0)))
+ if (!(vst = avformat_new_stream(s, NULL)))
return AVERROR(ENOMEM);
- if (!(ast = av_new_stream(s, 0)))
+ if (!(ast = avformat_new_stream(s, NULL)))
return AVERROR(ENOMEM);
ast->codec->sample_rate = avio_rl16(pb);
@@ -146,7 +146,7 @@ static int tmv_read_packet(AVFormatContext *s, AVPacket *pkt)
int ret, pkt_size = tmv->stream_index ?
tmv->audio_chunk_size : tmv->video_chunk_size;
- if (pb->eof_reached)
+ if (url_feof(pb))
return AVERROR_EOF;
ret = av_get_packet(pb, pkt, pkt_size);
@@ -173,19 +173,19 @@ static int tmv_read_seek(AVFormatContext *s, int stream_index,
pos = timestamp *
(tmv->audio_chunk_size + tmv->video_chunk_size + tmv->padding);
- avio_seek(s->pb, pos + TMV_HEADER_SIZE, SEEK_SET);
+ if (avio_seek(s->pb, pos + TMV_HEADER_SIZE, SEEK_SET) < 0)
+ return -1;
tmv->stream_index = 0;
return 0;
}
AVInputFormat ff_tmv_demuxer = {
- "tmv",
- NULL_IF_CONFIG_SMALL("8088flex TMV"),
- sizeof(TMVContext),
- tmv_probe,
- tmv_read_header,
- tmv_read_packet,
- NULL,
- tmv_read_seek,
+ .name = "tmv",
+ .long_name = NULL_IF_CONFIG_SMALL("8088flex TMV"),
+ .priv_data_size = sizeof(TMVContext),
+ .read_probe = tmv_probe,
+ .read_header = tmv_read_header,
+ .read_packet = tmv_read_packet,
+ .read_seek = tmv_read_seek,
.flags = AVFMT_GENERIC_INDEX,
};