From 223e70d6bde101349cba04b20ef243730cf84c07 Mon Sep 17 00:00:00 2001 From: James Dong Date: Mon, 5 Dec 2011 12:41:06 -0800 Subject: DO NOT MERGE - Consider I-Frame at zeroeth position when searching for sync frames The current logic does not check the I-frame at zeroeth position and therefore for the files with only 1 I-Frame at zeroeth postion does not play. Originally authored by Braganza Sam Robertsh Do not merge to master branch since we made some improvement to SampleTable.cpp in the master branch. Change-Id: I068184dec71986f14a586f769c2af1f52b4bcf94 related-to-bug: 5711942 --- media/libstagefright/SampleTable.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'media/libstagefright') diff --git a/media/libstagefright/SampleTable.cpp b/media/libstagefright/SampleTable.cpp index 69d1785..bf31947 100644 --- a/media/libstagefright/SampleTable.cpp +++ b/media/libstagefright/SampleTable.cpp @@ -627,6 +627,14 @@ status_t SampleTable::findSyncSampleNear( ++left; } + + if (left == mNumSyncSamples) { + if (flags == kFlagAfter) { + LOGE("tried to find a sync frame after the last one: %d", left); + return ERROR_OUT_OF_RANGE; + } + } + if (left > 0) { --left; } -- cgit v1.1