Check codec type instead of stream_index to determine video/audio

This commit is contained in:
Isaac Connor 2021-03-03 09:51:43 -05:00
parent 53425257cb
commit 9f5f215ef4
1 changed files with 2 additions and 2 deletions

View File

@ -945,9 +945,9 @@ bool VideoStore::setup_resampler() {
} // end bool VideoStore::setup_resampler()
int VideoStore::writePacket(ZMPacket *ipkt) {
if ( ipkt->packet.stream_index == video_in_stream_index ) {
if ( ipkt->codec_type == AVMEDIA_TYPE_VIDEO ) {
return writeVideoFramePacket(ipkt);
} else if ( ipkt->packet.stream_index == audio_in_stream_index ) {
} else if ( ipkt->codec_type == AVMEDIA_TYPE_AUDIO ) {
return writeAudioFramePacket(ipkt);
}
Error("Unknown stream type in packet (%d) input video stream is (%d) and audio is (%d)",