summaryrefslogtreecommitdiffstats
path: root/media/base/media_file_checker.cc
diff options
context:
space:
mode:
Diffstat (limited to 'media/base/media_file_checker.cc')
-rw-r--r--media/base/media_file_checker.cc6
1 files changed, 2 insertions, 4 deletions
diff --git a/media/base/media_file_checker.cc b/media/base/media_file_checker.cc
index 4a49ac7..418839d 100644
--- a/media/base/media_file_checker.cc
+++ b/media/base/media_file_checker.cc
@@ -84,20 +84,18 @@ bool MediaFileChecker::Start(base::TimeDelta check_time) {
// decoded; otherwise av_free_packet() will corrupt memory.
AVPacket temp_packet = packet;
do {
+ avcodec_get_frame_defaults(frame.get());
result = avcodec_decode_audio4(av_context, frame.get(), &frame_decoded,
&temp_packet);
if (result < 0)
break;
- av_frame_unref(frame.get());
temp_packet.size -= result;
temp_packet.data += result;
- frame_decoded = 0;
} while (temp_packet.size > 0);
} else if (av_context->codec_type == AVMEDIA_TYPE_VIDEO) {
+ avcodec_get_frame_defaults(frame.get());
result = avcodec_decode_video2(av_context, frame.get(), &frame_decoded,
&packet);
- if (result >= 0 && frame_decoded)
- av_frame_unref(frame.get());
}
av_free_packet(&packet);
} while (base::TimeTicks::Now() < deadline && read_ok && result >= 0);