static const uint8_t sync_header[12] = {0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x00};
-static int str_probe(AVProbeData *p)
+static int str_probe(const AVProbeData *p)
{
const uint8_t *sector= p->buf;
const uint8_t *end= sector + p->buf_size;
AVIOContext *pb = s->pb;
StrDemuxContext *str = s->priv_data;
unsigned char sector[RAW_CD_SECTOR_SIZE];
- int channel;
+ int channel, ret;
AVPacket *pkt;
AVStream *st;
if(pkt->data)
av_log(s, AV_LOG_ERROR, "mismatching sector_count\n");
av_packet_unref(pkt);
- if (av_new_packet(pkt, sector_count*VIDEO_DATA_CHUNK_SIZE))
- return AVERROR(EIO);
+ ret = av_new_packet(pkt, sector_count * VIDEO_DATA_CHUNK_SIZE);
+ if (ret < 0)
+ return ret;
memset(pkt->data, 0, sector_count*VIDEO_DATA_CHUNK_SIZE);
pkt->pos= avio_tell(pb) - RAW_CD_SECTOR_SIZE;
st->start_time = 0;
}
pkt = ret_pkt;
- if (av_new_packet(pkt, 2304))
- return AVERROR(EIO);
+ if ((ret = av_new_packet(pkt, 2304)) < 0)
+ return ret;
memcpy(pkt->data,sector+24,2304);
pkt->stream_index =
return 0;
}
-AVInputFormat ff_str_demuxer = {
+const AVInputFormat ff_str_demuxer = {
.name = "psxstr",
.long_name = NULL_IF_CONFIG_SMALL("Sony Playstation STR"),
.priv_data_size = sizeof(StrDemuxContext),