break;
case 1:
//audio
- if (!(st = s->streams[1])) {
+ if (s->nb_streams < 2) {
av_log(s, AV_LOG_INFO, "got audio packet, but no audio stream present\n");
break;
}
channels = bytestream_get_le32(&p);
track_size = bytestream_get_le32(&p);
+ st = s->streams[1];
+
//set codec based on specified audio bitdepth
//we only support tightly packed 16-, 20-, 24- and 32-bit PCM at the moment
st->codec->bits_per_coded_sample = (audio_format >> 6) & 0x3F;
{
LXFDemuxContext *lxf = s->priv_data;
AVIOContext *pb = s->pb;
- AVStream *ast = NULL;
uint32_t stream;
int ret, ret2;
return AVERROR(EAGAIN);
}
- if (stream == 1 && !(ast = s->streams[1])) {
+ if (stream == 1 && s->nb_streams < 2) {
av_log(s, AV_LOG_ERROR, "got audio packet without having an audio stream\n");
return AVERROR_INVALIDDATA;
}
pkt->stream_index = stream;
- if (!ast) {
+ if (!stream) {
//picture type (0 = closed I, 1 = open I, 2 = P, 3 = B)
if (((lxf->video_format >> 22) & 0x3) < 2)
pkt->flags |= AV_PKT_FLAG_KEY;