forked from FFmpeg/FFmpeg
lavf/dv: make returning the video packet optional
The mov demuxer only returns DV audio, video packets are discarded. It first reads the data to be parsed into a packet. Then both this packet and the pointer to its data are passed together to avpriv_dv_produce_packet(), which parses the data and partially overwrites the packet. This is confusing and potentially dangerous, so just pass NULL and avoid pointless packet modification.
This commit is contained in:
parent
f7b3fc4afe
commit
090f12b157
2 changed files with 12 additions and 9 deletions
|
@ -430,14 +430,17 @@ int avpriv_dv_produce_packet(DVDemuxContext *c, AVPacket *pkt,
|
|||
}
|
||||
}
|
||||
|
||||
/* Now it's time to return video packet */
|
||||
size = dv_extract_video_info(c, buf);
|
||||
pkt->data = buf;
|
||||
pkt->pos = pos;
|
||||
pkt->size = size;
|
||||
pkt->flags |= AV_PKT_FLAG_KEY;
|
||||
pkt->stream_index = c->vst->index;
|
||||
pkt->pts = c->frames;
|
||||
/* return the video packet, if the caller wants it */
|
||||
if (pkt) {
|
||||
size = dv_extract_video_info(c, buf);
|
||||
|
||||
pkt->data = buf;
|
||||
pkt->pos = pos;
|
||||
pkt->size = size;
|
||||
pkt->flags |= AV_PKT_FLAG_KEY;
|
||||
pkt->stream_index = c->vst->index;
|
||||
pkt->pts = c->frames;
|
||||
}
|
||||
|
||||
c->frames++;
|
||||
|
||||
|
|
|
@ -8777,7 +8777,7 @@ static int mov_read_packet(AVFormatContext *s, AVPacket *pkt)
|
|||
}
|
||||
#if CONFIG_DV_DEMUXER
|
||||
if (mov->dv_demux && sc->dv_audio_container) {
|
||||
ret = avpriv_dv_produce_packet(mov->dv_demux, pkt, pkt->data, pkt->size, pkt->pos);
|
||||
ret = avpriv_dv_produce_packet(mov->dv_demux, NULL, pkt->data, pkt->size, pkt->pos);
|
||||
av_packet_unref(pkt);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
|
Loading…
Add table
Reference in a new issue