Check codec type instead of stream_index to determine video/audio
This commit is contained in:
parent
53425257cb
commit
9f5f215ef4
|
@ -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)",
|
||||
|
|
Loading…
Reference in New Issue