From 00b870b94f1ad5c89eb7cd34835fd82836d94f46 Mon Sep 17 00:00:00 2001 From: martii Date: Mon, 22 Jul 2013 18:39:11 +0200 Subject: [PATCH] libeplayer3/container_ffmpeg.c: re-order packet.data check (not sure whether this is needed at all) Origin commit data ------------------ Branch: master Commit: https://github.com/neutrino-images/ni-libstb-hal/commit/b78249cd02abb7041edfa69539ada5b22d13960f Author: martii Date: 2013-07-22 (Mon, 22 Jul 2013) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- libeplayer3/container/container_ffmpeg.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/libeplayer3/container/container_ffmpeg.c b/libeplayer3/container/container_ffmpeg.c index af90ada..4dbcad2 100644 --- a/libeplayer3/container/container_ffmpeg.c +++ b/libeplayer3/container/container_ffmpeg.c @@ -427,6 +427,12 @@ static void FFMPEGThread(Context_t *context) { if (av_read_frame(avContext, &packet) == 0 ) { + if (!packet.data) { + ffmpeg_err("no data ->end of file reached ? \n"); + releaseMutex(FILENAME, __FUNCTION__,__LINE__); + break; + } + long long int pts; Track_t * videoTrack = NULL; Track_t * audioTrack = NULL; @@ -818,13 +824,7 @@ static void FFMPEGThread(Context_t *context) { } } - if (packet.data) - av_free_packet(&packet); - else { - ffmpeg_err("no data ->end of file reached ? \n"); - releaseMutex(FILENAME, __FUNCTION__,__LINE__); - break; - } + av_free_packet(&packet); releaseMutex(FILENAME, __FUNCTION__,__LINE__);