handle panic error on non-existing packet index (for audio, as example)
This commit is contained in:
		| @@ -154,6 +154,9 @@ func (self *Muxer) WriteHeader(streams []av.CodecData) (err error) { | ||||
| } | ||||
|  | ||||
| func (self *Muxer) WritePacket(pkt av.Packet) (err error) { | ||||
| 	if int(pkt.Idx) >= len(self.streams) { | ||||
| 		return fmt.Errorf("Wrong stream index: %d", pkt.Idx) | ||||
| 	} | ||||
| 	stream := self.streams[pkt.Idx] | ||||
| 	pkt.Time += time.Second | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Dimitrii Lopanov
					Dimitrii Lopanov