X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavformat%2Fffmdec.c;h=089609f3eebc1133bd436da32ba146567a76cfe4;hb=f320fb894c695044ef15239d27844d9ac01c9d16;hp=07f790773c889d6bedb1f5c26a3b89080e2997b9;hpb=4d58e4cb4ca8e04317fecea432ea3272a445877c;p=ffmpeg diff --git a/libavformat/ffmdec.c b/libavformat/ffmdec.c index 07f790773c8..089609f3eeb 100644 --- a/libavformat/ffmdec.c +++ b/libavformat/ffmdec.c @@ -20,8 +20,9 @@ */ #include "libavutil/intreadwrite.h" -#include "libavutil/intfloat_readwrite.h" +#include "libavutil/intfloat.h" #include "avformat.h" +#include "internal.h" #include "ffm.h" #if CONFIG_AVSERVER #include @@ -166,7 +167,7 @@ static int ffm_read_data(AVFormatContext *s, /* ensure that acutal seeking happens between FFM_PACKET_SIZE and file_size - FFM_PACKET_SIZE */ -static void ffm_seek1(AVFormatContext *s, int64_t pos1) +static int64_t ffm_seek1(AVFormatContext *s, int64_t pos1) { FFMContext *ffm = s->priv_data; AVIOContext *pb = s->pb; @@ -175,7 +176,7 @@ static void ffm_seek1(AVFormatContext *s, int64_t pos1) pos = FFMIN(pos1, ffm->file_size - FFM_PACKET_SIZE); pos = FFMAX(pos, FFM_PACKET_SIZE); av_dlog(s, "seek to %"PRIx64" -> %"PRIx64"\n", pos1, pos); - avio_seek(pb, pos, SEEK_SET); + return avio_seek(pb, pos, SEEK_SET); } static int64_t get_dts(AVFormatContext *s, int64_t pos) @@ -258,7 +259,7 @@ static int ffm_close(AVFormatContext *s) } -static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap) +static int ffm_read_header(AVFormatContext *s) { FFMContext *ffm = s->priv_data; AVStream *st; @@ -290,11 +291,11 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap) for(i=0;icodec; /* generic info */ @@ -324,10 +325,10 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap) codec->rc_max_rate = avio_rb32(pb); codec->rc_min_rate = avio_rb32(pb); codec->rc_buffer_size = avio_rb32(pb); - codec->i_quant_factor = av_int2dbl(avio_rb64(pb)); - codec->b_quant_factor = av_int2dbl(avio_rb64(pb)); - codec->i_quant_offset = av_int2dbl(avio_rb64(pb)); - codec->b_quant_offset = av_int2dbl(avio_rb64(pb)); + codec->i_quant_factor = av_int2double(avio_rb64(pb)); + codec->b_quant_factor = av_int2double(avio_rb64(pb)); + codec->i_quant_offset = av_int2double(avio_rb64(pb)); + codec->b_quant_offset = av_int2double(avio_rb64(pb)); codec->dct_algo = avio_rb32(pb); codec->strict_std_compliance = avio_rb32(pb); codec->max_b_frames = avio_rb32(pb); @@ -339,22 +340,20 @@ static int ffm_read_header(AVFormatContext *s, AVFormatParameters *ap) codec->mb_decision = avio_rb32(pb); codec->nsse_weight = avio_rb32(pb); codec->frame_skip_cmp = avio_rb32(pb); - codec->rc_buffer_aggressivity = av_int2dbl(avio_rb64(pb)); + codec->rc_buffer_aggressivity = av_int2double(avio_rb64(pb)); codec->codec_tag = avio_rb32(pb); codec->thread_count = avio_r8(pb); codec->coder_type = avio_rb32(pb); codec->me_cmp = avio_rb32(pb); - codec->partitions = avio_rb32(pb); codec->me_subpel_quality = avio_rb32(pb); codec->me_range = avio_rb32(pb); codec->keyint_min = avio_rb32(pb); codec->scenechange_threshold = avio_rb32(pb); codec->b_frame_strategy = avio_rb32(pb); - codec->qcompress = av_int2dbl(avio_rb64(pb)); - codec->qblur = av_int2dbl(avio_rb64(pb)); + codec->qcompress = av_int2double(avio_rb64(pb)); + codec->qblur = av_int2double(avio_rb64(pb)); codec->max_qdiff = avio_rb32(pb); codec->refs = avio_rb32(pb); - codec->directpred = avio_rb32(pb); break; case AVMEDIA_TYPE_AUDIO: codec->sample_rate = avio_rb32(pb); @@ -488,7 +487,8 @@ static int ffm_seek(AVFormatContext *s, int stream_index, int64_t wanted_pts, in pos = (flags & AVSEEK_FLAG_BACKWARD) ? pos_min : pos_max; found: - ffm_seek1(s, pos); + if (ffm_seek1(s, pos) < 0) + return -1; /* reset read state */ ffm->read_state = READ_HEADER;