diff options
author | wm4 <wm4@nowhere> | 2016-03-11 20:31:41 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2016-03-11 20:31:41 +0100 |
commit | 52d336e4c1f6345b43815b26373b9068e1c464a3 (patch) | |
tree | ba58e37175e4544d0307ddebedf354d79d22a6e1 /video | |
parent | 3c59f54ec8155ed9e58c996451851640b36c8cd4 (diff) | |
download | mpv-52d336e4c1f6345b43815b26373b9068e1c464a3.tar.bz2 mpv-52d336e4c1f6345b43815b26373b9068e1c464a3.tar.xz |
dec_video: reduce scope of variable
Almost only a cosmetic change, although it decreases pointless
referencing/dereferencing of the cover art packet too.
Diffstat (limited to 'video')
-rw-r--r-- | video/decode/dec_video.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/video/decode/dec_video.c b/video/decode/dec_video.c index fc0b090962..93a68dc468 100644 --- a/video/decode/dec_video.c +++ b/video/decode/dec_video.c @@ -363,20 +363,20 @@ void video_work(struct dec_video *d_video) return; if (d_video->header->attached_picture) { - struct demux_packet *packet = - demux_copy_packet(d_video->header->attached_picture); if (d_video->current_state == DATA_AGAIN && !d_video->cover_art_mpi) { + struct demux_packet *packet = + demux_copy_packet(d_video->header->attached_picture); d_video->cover_art_mpi = decode_packet(d_video, packet, 0); // Might need flush. if (!d_video->cover_art_mpi) d_video->cover_art_mpi = decode_packet(d_video, NULL, 0); d_video->current_state = DATA_OK; + talloc_free(packet); } if (d_video->current_state == DATA_OK) d_video->current_mpi = mp_image_new_ref(d_video->cover_art_mpi); // (DATA_OK is returned the first time, when current_mpi is sill set) d_video->current_state = DATA_EOF; - talloc_free(packet); return; } |