mirror of
https://github.com/nyanmisaka/ffmpeg-rockchip.git
synced 2025-10-15 13:21:09 +08:00
avformat: Remove unnecessary av_packet_unref()
Since bae8844e
the packet will always be unreferenced when a demuxer
returns an error, so that a lot of calls to av_packet_unref() in lots of
demuxers are now redundant and can be removed.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Signed-off-by: Marton Balint <cus@passwd.hu>
This commit is contained in:

committed by
Marton Balint

parent
bbea268aa8
commit
6a67d518d6
@@ -197,15 +197,13 @@ int ff_spdif_read_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
pkt->pos = avio_tell(pb) - BURST_HEADER_SIZE;
|
||||
|
||||
if (avio_read(pb, pkt->data, pkt->size) < pkt->size) {
|
||||
av_packet_unref(pkt);
|
||||
return AVERROR_EOF;
|
||||
}
|
||||
ff_spdif_bswap_buf16((uint16_t *)pkt->data, (uint16_t *)pkt->data, pkt->size >> 1);
|
||||
|
||||
ret = spdif_get_offset_and_codec(s, data_type, pkt->data,
|
||||
&offset, &codec_id);
|
||||
if (ret) {
|
||||
av_packet_unref(pkt);
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -216,7 +214,6 @@ int ff_spdif_read_packet(AVFormatContext *s, AVPacket *pkt)
|
||||
/* first packet, create a stream */
|
||||
AVStream *st = avformat_new_stream(s, NULL);
|
||||
if (!st) {
|
||||
av_packet_unref(pkt);
|
||||
return AVERROR(ENOMEM);
|
||||
}
|
||||
st->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
|
||||
|
Reference in New Issue
Block a user