summaryrefslogtreecommitdiff
path: root/libavformat/electronicarts.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/electronicarts.c')
-rw-r--r--libavformat/electronicarts.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/libavformat/electronicarts.c b/libavformat/electronicarts.c
index 0facc8afba..802352a852 100644
--- a/libavformat/electronicarts.c
+++ b/libavformat/electronicarts.c
@@ -2,20 +2,20 @@
* Copyright (c) 2004 The ffmpeg Project
* Copyright (c) 2006-2008 Peter Ross
*
- * 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
*/
@@ -110,7 +110,7 @@ static int process_audio_header_elements(AVFormatContext *s)
ea->sample_rate = -1;
ea->num_channels = 1;
- while (!pb->eof_reached && inHeader) {
+ while (!url_feof(pb) && inHeader) {
int inSubheader;
uint8_t byte;
byte = avio_r8(pb);
@@ -119,7 +119,7 @@ static int process_audio_header_elements(AVFormatContext *s)
case 0xFD:
av_log (s, AV_LOG_DEBUG, "entered audio subheader\n");
inSubheader = 1;
- while (!pb->eof_reached && inSubheader) {
+ while (!url_feof(pb) && inSubheader) {
uint8_t subbyte;
subbyte = avio_r8(pb);
@@ -331,12 +331,10 @@ static int process_ea_header(AVFormatContext *s) {
case MVIh_TAG :
ea->video_codec = CODEC_ID_CMV;
- ea->time_base = (AVRational){0,0};
break;
case kVGT_TAG:
ea->video_codec = CODEC_ID_TGV;
- ea->time_base = (AVRational){0,0};
break;
case mTCD_TAG :
@@ -417,8 +415,12 @@ static int ea_read_header(AVFormatContext *s,
ea->video_stream_index = st->index;
st->codec->codec_type = AVMEDIA_TYPE_VIDEO;
st->codec->codec_id = ea->video_codec;
+ // parsing is necessary to make FFmpeg generate correct timestamps
+ if (st->codec->codec_id == CODEC_ID_MPEG2VIDEO)
+ st->need_parsing = AVSTREAM_PARSE_HEADERS;
st->codec->codec_tag = 0; /* no fourcc */
- st->codec->time_base = ea->time_base;
+ if (ea->time_base.num)
+ av_set_pts_info(st, 64, ea->time_base.num, ea->time_base.den);
st->codec->width = ea->width;
st->codec->height = ea->height;
}