- url_fseek(pb, start, SEEK_SET);
-
- /* check through the first 32 sectors for individual channels */
- for (i = 0; i < 32; i++) {
- if (get_buffer(pb, sector, RAW_CD_SECTOR_SIZE) != RAW_CD_SECTOR_SIZE)
- return AVERROR_IO;
-
-//printf("%02x %02x %02x %02x\n",sector[0x10],sector[0x11],sector[0x12],sector[0x13]);
-
- channel = sector[0x11];
- if (channel >= 32)
- return AVERROR_INVALIDDATA;
-
- switch (sector[0x12] & CDXA_TYPE_MASK) {
-
- case CDXA_TYPE_DATA:
- case CDXA_TYPE_VIDEO:
- /* check if this channel gets to be the dominant video channel */
- if (str->video_channel == -1) {
- /* qualify the magic number */
- if (LE_32(§or[0x18]) != STR_MAGIC)
- break;
- str->video_channel = channel;
- str->channels[channel].type = STR_VIDEO;
- str->channels[channel].width = LE_16(§or[0x28]);
- str->channels[channel].height = LE_16(§or[0x2A]);
-
- /* allocate a new AVStream */
- st = av_new_stream(s, 0);
- if (!st)
- return AVERROR_NOMEM;
- /* set the pts reference (1 pts = 1/90000) */
- av_set_pts_info(st, 33, 1, 90000);
-
- str->channels[channel].video_stream_index = st->index;
-
- st->codec.codec_type = CODEC_TYPE_VIDEO;
- st->codec.codec_id = CODEC_ID_MDEC;
- st->codec.codec_tag = 0; /* no fourcc */
- st->codec.width = str->channels[channel].width;
- st->codec.height = str->channels[channel].height;
- }
- break;