00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include "libavutil/intreadwrite.h"
00023 #include "libavutil/intfloat.h"
00024 #include "avformat.h"
00025 #include "internal.h"
00026 #include "ffm.h"
00027 #include "avio_internal.h"
00028
00029 static int ffm_is_avail_data(AVFormatContext *s, int size)
00030 {
00031 FFMContext *ffm = s->priv_data;
00032 int64_t pos, avail_size;
00033 int len;
00034
00035 len = ffm->packet_end - ffm->packet_ptr;
00036 if (size <= len)
00037 return 1;
00038 pos = avio_tell(s->pb);
00039 if (!ffm->write_index) {
00040 if (pos == ffm->file_size)
00041 return AVERROR_EOF;
00042 avail_size = ffm->file_size - pos;
00043 } else {
00044 if (pos == ffm->write_index) {
00045
00046 return AVERROR(EAGAIN);
00047 } else if (pos < ffm->write_index) {
00048 avail_size = ffm->write_index - pos;
00049 } else {
00050 avail_size = (ffm->file_size - pos) + (ffm->write_index - FFM_PACKET_SIZE);
00051 }
00052 }
00053 avail_size = (avail_size / ffm->packet_size) * (ffm->packet_size - FFM_HEADER_SIZE) + len;
00054 if (size <= avail_size)
00055 return 1;
00056 else
00057 return AVERROR(EAGAIN);
00058 }
00059
00060 static int ffm_resync(AVFormatContext *s, int state)
00061 {
00062 av_log(s, AV_LOG_ERROR, "resyncing\n");
00063 while (state != PACKET_ID) {
00064 if (url_feof(s->pb)) {
00065 av_log(s, AV_LOG_ERROR, "cannot find FFM syncword\n");
00066 return -1;
00067 }
00068 state = (state << 8) | avio_r8(s->pb);
00069 }
00070 return 0;
00071 }
00072
00073
00074 static int ffm_read_data(AVFormatContext *s,
00075 uint8_t *buf, int size, int header)
00076 {
00077 FFMContext *ffm = s->priv_data;
00078 AVIOContext *pb = s->pb;
00079 int len, fill_size, size1, frame_offset, id;
00080
00081 size1 = size;
00082 while (size > 0) {
00083 redo:
00084 len = ffm->packet_end - ffm->packet_ptr;
00085 if (len < 0)
00086 return -1;
00087 if (len > size)
00088 len = size;
00089 if (len == 0) {
00090 if (avio_tell(pb) == ffm->file_size)
00091 avio_seek(pb, ffm->packet_size, SEEK_SET);
00092 retry_read:
00093 if (pb->buffer_size != ffm->packet_size) {
00094 int64_t tell = avio_tell(pb);
00095 ffio_set_buf_size(pb, ffm->packet_size);
00096 avio_seek(pb, tell, SEEK_SET);
00097 }
00098 id = avio_rb16(pb);
00099 if (id != PACKET_ID)
00100 if (ffm_resync(s, id) < 0)
00101 return -1;
00102 fill_size = avio_rb16(pb);
00103 ffm->dts = avio_rb64(pb);
00104 frame_offset = avio_rb16(pb);
00105 avio_read(pb, ffm->packet, ffm->packet_size - FFM_HEADER_SIZE);
00106 ffm->packet_end = ffm->packet + (ffm->packet_size - FFM_HEADER_SIZE - fill_size);
00107 if (ffm->packet_end < ffm->packet || frame_offset < 0)
00108 return -1;
00109
00110
00111 if (ffm->first_packet || (frame_offset & 0x8000)) {
00112 if (!frame_offset) {
00113
00114 if (avio_tell(pb) >= ffm->packet_size * 3LL) {
00115 avio_seek(pb, -ffm->packet_size * 2LL, SEEK_CUR);
00116 goto retry_read;
00117 }
00118
00119 return 0;
00120 }
00121 ffm->first_packet = 0;
00122 if ((frame_offset & 0x7fff) < FFM_HEADER_SIZE)
00123 return -1;
00124 ffm->packet_ptr = ffm->packet + (frame_offset & 0x7fff) - FFM_HEADER_SIZE;
00125 if (!header)
00126 break;
00127 } else {
00128 ffm->packet_ptr = ffm->packet;
00129 }
00130 goto redo;
00131 }
00132 memcpy(buf, ffm->packet_ptr, len);
00133 buf += len;
00134 ffm->packet_ptr += len;
00135 size -= len;
00136 header = 0;
00137 }
00138 return size1 - size;
00139 }
00140
00141
00142
00143 static int64_t ffm_seek1(AVFormatContext *s, int64_t pos1)
00144 {
00145 FFMContext *ffm = s->priv_data;
00146 AVIOContext *pb = s->pb;
00147 int64_t pos;
00148
00149 pos = FFMIN(pos1, ffm->file_size - FFM_PACKET_SIZE);
00150 pos = FFMAX(pos, FFM_PACKET_SIZE);
00151 av_dlog(s, "seek to %"PRIx64" -> %"PRIx64"\n", pos1, pos);
00152 return avio_seek(pb, pos, SEEK_SET);
00153 }
00154
00155 static int64_t get_dts(AVFormatContext *s, int64_t pos)
00156 {
00157 AVIOContext *pb = s->pb;
00158 int64_t dts;
00159
00160 ffm_seek1(s, pos);
00161 avio_skip(pb, 4);
00162 dts = avio_rb64(pb);
00163 av_dlog(s, "dts=%0.6f\n", dts / 1000000.0);
00164 return dts;
00165 }
00166
00167 static void adjust_write_index(AVFormatContext *s)
00168 {
00169 FFMContext *ffm = s->priv_data;
00170 AVIOContext *pb = s->pb;
00171 int64_t pts;
00172
00173 int64_t pos_min, pos_max;
00174 int64_t pts_start;
00175 int64_t ptr = avio_tell(pb);
00176
00177
00178 pos_min = 0;
00179 pos_max = ffm->file_size - 2 * FFM_PACKET_SIZE;
00180
00181 pts_start = get_dts(s, pos_min);
00182
00183 pts = get_dts(s, pos_max);
00184
00185 if (pts - 100000 > pts_start)
00186 goto end;
00187
00188 ffm->write_index = FFM_PACKET_SIZE;
00189
00190 pts_start = get_dts(s, pos_min);
00191
00192 pts = get_dts(s, pos_max);
00193
00194 if (pts - 100000 <= pts_start) {
00195 while (1) {
00196 int64_t newpos;
00197 int64_t newpts;
00198
00199 newpos = ((pos_max + pos_min) / (2 * FFM_PACKET_SIZE)) * FFM_PACKET_SIZE;
00200
00201 if (newpos == pos_min)
00202 break;
00203
00204 newpts = get_dts(s, newpos);
00205
00206 if (newpts - 100000 <= pts) {
00207 pos_max = newpos;
00208 pts = newpts;
00209 } else {
00210 pos_min = newpos;
00211 }
00212 }
00213 ffm->write_index += pos_max;
00214 }
00215
00216 end:
00217 avio_seek(pb, ptr, SEEK_SET);
00218 }
00219
00220
00221 static int ffm_close(AVFormatContext *s)
00222 {
00223 int i;
00224
00225 for (i = 0; i < s->nb_streams; i++)
00226 av_freep(&s->streams[i]->codec->rc_eq);
00227
00228 return 0;
00229 }
00230
00231 static int ffm2_read_header(AVFormatContext *s)
00232 {
00233 FFMContext *ffm = s->priv_data;
00234 AVStream *st;
00235 AVIOContext *pb = s->pb;
00236 AVCodecContext *codec;
00237
00238 ffm->packet_size = avio_rb32(pb);
00239 if (ffm->packet_size != FFM_PACKET_SIZE)
00240 goto fail;
00241 ffm->write_index = avio_rb64(pb);
00242
00243 if (pb->seekable) {
00244 ffm->file_size = avio_size(pb);
00245 if (ffm->write_index && 0)
00246 adjust_write_index(s);
00247 } else {
00248 ffm->file_size = (UINT64_C(1) << 63) - 1;
00249 }
00250
00251 while(!url_feof(pb)) {
00252 unsigned id = avio_rb32(pb);
00253 unsigned size = avio_rb32(pb);
00254 int64_t next = avio_tell(pb) + size;
00255 char rc_eq_buf[128];
00256
00257 if(!id)
00258 break;
00259
00260 switch(id) {
00261 case MKBETAG('M', 'A', 'I', 'N'):
00262 avio_rb32(pb);
00263 avio_rb32(pb);
00264 break;
00265 case MKBETAG('C', 'O', 'M', 'M'):
00266 st = avformat_new_stream(s, NULL);
00267 if (!st)
00268 goto fail;
00269
00270 avpriv_set_pts_info(st, 64, 1, 1000000);
00271
00272 codec = st->codec;
00273
00274 codec->codec_id = avio_rb32(pb);
00275 codec->codec_type = avio_r8(pb);
00276 codec->bit_rate = avio_rb32(pb);
00277 codec->flags = avio_rb32(pb);
00278 codec->flags2 = avio_rb32(pb);
00279 codec->debug = avio_rb32(pb);
00280 if (codec->flags & CODEC_FLAG_GLOBAL_HEADER) {
00281 codec->extradata_size = avio_rb32(pb);
00282 codec->extradata = av_malloc(codec->extradata_size);
00283 if (!codec->extradata)
00284 return AVERROR(ENOMEM);
00285 avio_read(pb, codec->extradata, codec->extradata_size);
00286 }
00287 avio_seek(pb, next, SEEK_SET);
00288 id = avio_rb32(pb);
00289 size = avio_rb32(pb);
00290 next = avio_tell(pb) + size;
00291 switch(id) {
00292 case MKBETAG('S', 'T', 'V', 'I'):
00293 codec->time_base.num = avio_rb32(pb);
00294 codec->time_base.den = avio_rb32(pb);
00295 codec->width = avio_rb16(pb);
00296 codec->height = avio_rb16(pb);
00297 codec->gop_size = avio_rb16(pb);
00298 codec->pix_fmt = avio_rb32(pb);
00299 codec->qmin = avio_r8(pb);
00300 codec->qmax = avio_r8(pb);
00301 codec->max_qdiff = avio_r8(pb);
00302 codec->qcompress = avio_rb16(pb) / 10000.0;
00303 codec->qblur = avio_rb16(pb) / 10000.0;
00304 codec->bit_rate_tolerance = avio_rb32(pb);
00305 avio_get_str(pb, INT_MAX, rc_eq_buf, sizeof(rc_eq_buf));
00306 codec->rc_eq = av_strdup(rc_eq_buf);
00307 codec->rc_max_rate = avio_rb32(pb);
00308 codec->rc_min_rate = avio_rb32(pb);
00309 codec->rc_buffer_size = avio_rb32(pb);
00310 codec->i_quant_factor = av_int2double(avio_rb64(pb));
00311 codec->b_quant_factor = av_int2double(avio_rb64(pb));
00312 codec->i_quant_offset = av_int2double(avio_rb64(pb));
00313 codec->b_quant_offset = av_int2double(avio_rb64(pb));
00314 codec->dct_algo = avio_rb32(pb);
00315 codec->strict_std_compliance = avio_rb32(pb);
00316 codec->max_b_frames = avio_rb32(pb);
00317 codec->mpeg_quant = avio_rb32(pb);
00318 codec->intra_dc_precision = avio_rb32(pb);
00319 codec->me_method = avio_rb32(pb);
00320 codec->mb_decision = avio_rb32(pb);
00321 codec->nsse_weight = avio_rb32(pb);
00322 codec->frame_skip_cmp = avio_rb32(pb);
00323 codec->rc_buffer_aggressivity = av_int2double(avio_rb64(pb));
00324 codec->codec_tag = avio_rb32(pb);
00325 codec->thread_count = avio_r8(pb);
00326 codec->coder_type = avio_rb32(pb);
00327 codec->me_cmp = avio_rb32(pb);
00328 codec->me_subpel_quality = avio_rb32(pb);
00329 codec->me_range = avio_rb32(pb);
00330 codec->keyint_min = avio_rb32(pb);
00331 codec->scenechange_threshold = avio_rb32(pb);
00332 codec->b_frame_strategy = avio_rb32(pb);
00333 codec->qcompress = av_int2double(avio_rb64(pb));
00334 codec->qblur = av_int2double(avio_rb64(pb));
00335 codec->max_qdiff = avio_rb32(pb);
00336 codec->refs = avio_rb32(pb);
00337 break;
00338 case MKBETAG('S', 'T', 'A', 'U'):
00339 codec->sample_rate = avio_rb32(pb);
00340 codec->channels = avio_rl16(pb);
00341 codec->frame_size = avio_rl16(pb);
00342 break;
00343 }
00344 break;
00345 }
00346 avio_seek(pb, next, SEEK_SET);
00347 }
00348
00349
00350 while ((avio_tell(pb) % ffm->packet_size) != 0)
00351 avio_r8(pb);
00352
00353
00354 ffm->packet_ptr = ffm->packet;
00355 ffm->packet_end = ffm->packet;
00356 ffm->frame_offset = 0;
00357 ffm->dts = 0;
00358 ffm->read_state = READ_HEADER;
00359 ffm->first_packet = 1;
00360 return 0;
00361 fail:
00362 ffm_close(s);
00363 return -1;
00364 }
00365
00366 static int ffm_read_header(AVFormatContext *s)
00367 {
00368 FFMContext *ffm = s->priv_data;
00369 AVStream *st;
00370 AVIOContext *pb = s->pb;
00371 AVCodecContext *codec;
00372 int i, nb_streams;
00373 uint32_t tag;
00374
00375
00376 tag = avio_rl32(pb);
00377 if (tag == MKTAG('F', 'F', 'M', '2'))
00378 return ffm2_read_header(s);
00379 if (tag != MKTAG('F', 'F', 'M', '1'))
00380 goto fail;
00381 ffm->packet_size = avio_rb32(pb);
00382 if (ffm->packet_size != FFM_PACKET_SIZE)
00383 goto fail;
00384 ffm->write_index = avio_rb64(pb);
00385
00386 if (pb->seekable) {
00387 ffm->file_size = avio_size(pb);
00388 if (ffm->write_index && 0)
00389 adjust_write_index(s);
00390 } else {
00391 ffm->file_size = (UINT64_C(1) << 63) - 1;
00392 }
00393
00394 nb_streams = avio_rb32(pb);
00395 avio_rb32(pb);
00396
00397 for(i=0;i<nb_streams;i++) {
00398 char rc_eq_buf[128];
00399
00400 st = avformat_new_stream(s, NULL);
00401 if (!st)
00402 goto fail;
00403
00404 avpriv_set_pts_info(st, 64, 1, 1000000);
00405
00406 codec = st->codec;
00407
00408 codec->codec_id = avio_rb32(pb);
00409 codec->codec_type = avio_r8(pb);
00410 codec->bit_rate = avio_rb32(pb);
00411 codec->flags = avio_rb32(pb);
00412 codec->flags2 = avio_rb32(pb);
00413 codec->debug = avio_rb32(pb);
00414
00415 switch(codec->codec_type) {
00416 case AVMEDIA_TYPE_VIDEO:
00417 codec->time_base.num = avio_rb32(pb);
00418 codec->time_base.den = avio_rb32(pb);
00419 codec->width = avio_rb16(pb);
00420 codec->height = avio_rb16(pb);
00421 codec->gop_size = avio_rb16(pb);
00422 codec->pix_fmt = avio_rb32(pb);
00423 codec->qmin = avio_r8(pb);
00424 codec->qmax = avio_r8(pb);
00425 codec->max_qdiff = avio_r8(pb);
00426 codec->qcompress = avio_rb16(pb) / 10000.0;
00427 codec->qblur = avio_rb16(pb) / 10000.0;
00428 codec->bit_rate_tolerance = avio_rb32(pb);
00429 avio_get_str(pb, INT_MAX, rc_eq_buf, sizeof(rc_eq_buf));
00430 codec->rc_eq = av_strdup(rc_eq_buf);
00431 codec->rc_max_rate = avio_rb32(pb);
00432 codec->rc_min_rate = avio_rb32(pb);
00433 codec->rc_buffer_size = avio_rb32(pb);
00434 codec->i_quant_factor = av_int2double(avio_rb64(pb));
00435 codec->b_quant_factor = av_int2double(avio_rb64(pb));
00436 codec->i_quant_offset = av_int2double(avio_rb64(pb));
00437 codec->b_quant_offset = av_int2double(avio_rb64(pb));
00438 codec->dct_algo = avio_rb32(pb);
00439 codec->strict_std_compliance = avio_rb32(pb);
00440 codec->max_b_frames = avio_rb32(pb);
00441 codec->mpeg_quant = avio_rb32(pb);
00442 codec->intra_dc_precision = avio_rb32(pb);
00443 codec->me_method = avio_rb32(pb);
00444 codec->mb_decision = avio_rb32(pb);
00445 codec->nsse_weight = avio_rb32(pb);
00446 codec->frame_skip_cmp = avio_rb32(pb);
00447 codec->rc_buffer_aggressivity = av_int2double(avio_rb64(pb));
00448 codec->codec_tag = avio_rb32(pb);
00449 codec->thread_count = avio_r8(pb);
00450 codec->coder_type = avio_rb32(pb);
00451 codec->me_cmp = avio_rb32(pb);
00452 codec->me_subpel_quality = avio_rb32(pb);
00453 codec->me_range = avio_rb32(pb);
00454 codec->keyint_min = avio_rb32(pb);
00455 codec->scenechange_threshold = avio_rb32(pb);
00456 codec->b_frame_strategy = avio_rb32(pb);
00457 codec->qcompress = av_int2double(avio_rb64(pb));
00458 codec->qblur = av_int2double(avio_rb64(pb));
00459 codec->max_qdiff = avio_rb32(pb);
00460 codec->refs = avio_rb32(pb);
00461 break;
00462 case AVMEDIA_TYPE_AUDIO:
00463 codec->sample_rate = avio_rb32(pb);
00464 codec->channels = avio_rl16(pb);
00465 codec->frame_size = avio_rl16(pb);
00466 break;
00467 default:
00468 goto fail;
00469 }
00470 if (codec->flags & CODEC_FLAG_GLOBAL_HEADER) {
00471 codec->extradata_size = avio_rb32(pb);
00472 codec->extradata = av_malloc(codec->extradata_size);
00473 if (!codec->extradata)
00474 return AVERROR(ENOMEM);
00475 avio_read(pb, codec->extradata, codec->extradata_size);
00476 }
00477 }
00478
00479
00480 while ((avio_tell(pb) % ffm->packet_size) != 0)
00481 avio_r8(pb);
00482
00483
00484 ffm->packet_ptr = ffm->packet;
00485 ffm->packet_end = ffm->packet;
00486 ffm->frame_offset = 0;
00487 ffm->dts = 0;
00488 ffm->read_state = READ_HEADER;
00489 ffm->first_packet = 1;
00490 return 0;
00491 fail:
00492 ffm_close(s);
00493 return -1;
00494 }
00495
00496
00497 static int ffm_read_packet(AVFormatContext *s, AVPacket *pkt)
00498 {
00499 int size;
00500 FFMContext *ffm = s->priv_data;
00501 int duration, ret;
00502
00503 switch(ffm->read_state) {
00504 case READ_HEADER:
00505 if ((ret = ffm_is_avail_data(s, FRAME_HEADER_SIZE+4)) < 0)
00506 return ret;
00507
00508 av_dlog(s, "pos=%08"PRIx64" spos=%"PRIx64", write_index=%"PRIx64" size=%"PRIx64"\n",
00509 avio_tell(s->pb), s->pb->pos, ffm->write_index, ffm->file_size);
00510 if (ffm_read_data(s, ffm->header, FRAME_HEADER_SIZE, 1) !=
00511 FRAME_HEADER_SIZE)
00512 return -1;
00513 if (ffm->header[1] & FLAG_DTS)
00514 if (ffm_read_data(s, ffm->header+16, 4, 1) != 4)
00515 return -1;
00516 ffm->read_state = READ_DATA;
00517
00518 case READ_DATA:
00519 size = AV_RB24(ffm->header + 2);
00520 if ((ret = ffm_is_avail_data(s, size)) < 0)
00521 return ret;
00522
00523 duration = AV_RB24(ffm->header + 5);
00524
00525 if (av_new_packet(pkt, size) < 0) {
00526 return AVERROR(ENOMEM);
00527 }
00528 pkt->stream_index = ffm->header[0];
00529 if ((unsigned)pkt->stream_index >= s->nb_streams) {
00530 av_log(s, AV_LOG_ERROR, "invalid stream index %d\n", pkt->stream_index);
00531 av_free_packet(pkt);
00532 ffm->read_state = READ_HEADER;
00533 return -1;
00534 }
00535 pkt->pos = avio_tell(s->pb);
00536 if (ffm->header[1] & FLAG_KEY_FRAME)
00537 pkt->flags |= AV_PKT_FLAG_KEY;
00538
00539 ffm->read_state = READ_HEADER;
00540 if (ffm_read_data(s, pkt->data, size, 0) != size) {
00541
00542 av_free_packet(pkt);
00543 return -1;
00544 }
00545 pkt->pts = AV_RB64(ffm->header+8);
00546 if (ffm->header[1] & FLAG_DTS)
00547 pkt->dts = pkt->pts - AV_RB32(ffm->header+16);
00548 else
00549 pkt->dts = pkt->pts;
00550 pkt->duration = duration;
00551 break;
00552 }
00553 return 0;
00554 }
00555
00556
00557
00558
00559 static int ffm_seek(AVFormatContext *s, int stream_index, int64_t wanted_pts, int flags)
00560 {
00561 FFMContext *ffm = s->priv_data;
00562 int64_t pos_min, pos_max, pos;
00563 int64_t pts_min, pts_max, pts;
00564 double pos1;
00565
00566 av_dlog(s, "wanted_pts=%0.6f\n", wanted_pts / 1000000.0);
00567
00568
00569 if (ffm->write_index && ffm->write_index < ffm->file_size) {
00570 if (get_dts(s, FFM_PACKET_SIZE) < wanted_pts) {
00571 pos_min = FFM_PACKET_SIZE;
00572 pos_max = ffm->write_index - FFM_PACKET_SIZE;
00573 } else {
00574 pos_min = ffm->write_index;
00575 pos_max = ffm->file_size - FFM_PACKET_SIZE;
00576 }
00577 } else {
00578 pos_min = FFM_PACKET_SIZE;
00579 pos_max = ffm->file_size - FFM_PACKET_SIZE;
00580 }
00581 while (pos_min <= pos_max) {
00582 pts_min = get_dts(s, pos_min);
00583 pts_max = get_dts(s, pos_max);
00584 if (pts_min > wanted_pts || pts_max <= wanted_pts) {
00585 pos = pts_min > wanted_pts ? pos_min : pos_max;
00586 goto found;
00587 }
00588
00589 pos1 = (double)(pos_max - pos_min) * (double)(wanted_pts - pts_min) /
00590 (double)(pts_max - pts_min);
00591 pos = (((int64_t)pos1) / FFM_PACKET_SIZE) * FFM_PACKET_SIZE;
00592 if (pos <= pos_min)
00593 pos = pos_min;
00594 else if (pos >= pos_max)
00595 pos = pos_max;
00596 pts = get_dts(s, pos);
00597
00598 if (pts == wanted_pts) {
00599 goto found;
00600 } else if (pts > wanted_pts) {
00601 pos_max = pos - FFM_PACKET_SIZE;
00602 } else {
00603 pos_min = pos + FFM_PACKET_SIZE;
00604 }
00605 }
00606 pos = (flags & AVSEEK_FLAG_BACKWARD) ? pos_min : pos_max;
00607
00608 found:
00609 if (ffm_seek1(s, pos) < 0)
00610 return -1;
00611
00612
00613 ffm->read_state = READ_HEADER;
00614 ffm->packet_ptr = ffm->packet;
00615 ffm->packet_end = ffm->packet;
00616 ffm->first_packet = 1;
00617
00618 return 0;
00619 }
00620
00621 static int ffm_probe(AVProbeData *p)
00622 {
00623 if (
00624 p->buf[0] == 'F' && p->buf[1] == 'F' && p->buf[2] == 'M' &&
00625 (p->buf[3] == '1' || p->buf[3] == '2'))
00626 return AVPROBE_SCORE_MAX + 1;
00627 return 0;
00628 }
00629
00630 AVInputFormat ff_ffm_demuxer = {
00631 .name = "ffm",
00632 .long_name = NULL_IF_CONFIG_SMALL("FFM (FFserver live feed)"),
00633 .priv_data_size = sizeof(FFMContext),
00634 .read_probe = ffm_probe,
00635 .read_header = ffm_read_header,
00636 .read_packet = ffm_read_packet,
00637 .read_close = ffm_close,
00638 .read_seek = ffm_seek,
00639 };