Minor cleanup

This commit is contained in:
Oliver Woodman 2017-08-01 18:20:54 +01:00
parent c01c8cd2a6
commit 1a95a35434
4 changed files with 15 additions and 14 deletions

View File

@ -69,7 +69,7 @@ track 224:
sample 0: sample 0:
time = 40000 time = 40000
flags = 1 flags = 1
data = length 20616, hash CA38A5B5 data = length 20646, hash 576390B
sample 1: sample 1:
time = 80000 time = 80000
flags = 0 flags = 0

View File

@ -28,9 +28,9 @@ track 256:
data = length 22, hash CE183139 data = length 22, hash CE183139
sample count = 2 sample count = 2
sample 0: sample 0:
time = 33366 time = 0
flags = 1 flags = 1
data = length 20669, hash 26DABA0F data = length 20711, hash 34341E8
sample 1: sample 1:
time = 66733 time = 66733
flags = 0 flags = 0

View File

@ -137,9 +137,10 @@ public final class H262Reader implements ElementaryStreamReader {
} }
} }
if (hasOutputFormat && (startCodeValue == START_PICTURE || startCodeValue == START_SEQUENCE_HEADER)) { if (hasOutputFormat
&& (startCodeValue == START_PICTURE || startCodeValue == START_SEQUENCE_HEADER)) {
int bytesWrittenPastStartCode = limit - startCodeOffset; int bytesWrittenPastStartCode = limit - startCodeOffset;
boolean resetSample = (samplePosition == C.POSITION_UNSET); boolean resetSample = samplePosition == C.POSITION_UNSET;
if (foundPicture) { if (foundPicture) {
@C.BufferFlags int flags = isKeyframe ? C.BUFFER_FLAG_KEY_FRAME : 0; @C.BufferFlags int flags = isKeyframe ? C.BUFFER_FLAG_KEY_FRAME : 0;
int size = (int) (totalBytesWritten - samplePosition) - bytesWrittenPastStartCode; int size = (int) (totalBytesWritten - samplePosition) - bytesWrittenPastStartCode;
@ -147,7 +148,7 @@ public final class H262Reader implements ElementaryStreamReader {
isKeyframe = false; isKeyframe = false;
resetSample = true; resetSample = true;
} }
foundPicture = (startCodeValue == START_PICTURE); foundPicture = startCodeValue == START_PICTURE;
if (resetSample) { if (resetSample) {
samplePosition = totalBytesWritten - bytesWrittenPastStartCode; samplePosition = totalBytesWritten - bytesWrittenPastStartCode;
sampleTimeUs = (pesPtsUsAvailable ? pesTimeUs : sampleTimeUs + frameDurationUs); sampleTimeUs = (pesPtsUsAvailable ? pesTimeUs : sampleTimeUs + frameDurationUs);

View File

@ -126,7 +126,8 @@ import java.util.List;
* <li>Default: {@code R.id.exo_playback_control_view}</li> * <li>Default: {@code R.id.exo_playback_control_view}</li>
* </ul> * </ul>
* <li>All attributes that can be set on a {@link PlaybackControlView} can also be set on a * <li>All attributes that can be set on a {@link PlaybackControlView} can also be set on a
* SimpleExoPlayerView, and will be propagated to the inflated {@link PlaybackControlView}. * SimpleExoPlayerView, and will be propagated to the inflated {@link PlaybackControlView}
* unless the layout is overridden to specify a custom {@code exo_controller} (see below).
* </li> * </li>
* </ul> * </ul>
* *
@ -163,18 +164,17 @@ import java.util.List;
* </ul> * </ul>
* </li> * </li>
* <li><b>{@code exo_controller_placeholder}</b> - A placeholder that's replaced with the inflated * <li><b>{@code exo_controller_placeholder}</b> - A placeholder that's replaced with the inflated
* {@link PlaybackControlView}. * {@link PlaybackControlView}. Ignored if an {@code exo_controller} view exists.
* <ul> * <ul>
* <li>Type: {@link View}</li> * <li>Type: {@link View}</li>
* </ul> * </ul>
* </li> * </li>
* <li><b>{@code exo_controller}</b> - An already inflated instance of * <li><b>{@code exo_controller}</b> - An already inflated {@link PlaybackControlView}. Allows use
* {@link PlaybackControlView}. Allows you to use your own {@link PlaybackControlView} instead * of a custom extension of {@link PlaybackControlView}. Note that attributes such as
* of default. Note: attrs such as rewind_increment will not be passed through to this * {@code rewind_increment} will not be automatically propagated through to this instance. If
* instance and should be set at creation. {@code exo_controller_placeholder} will be ignored * a view exists with this id, any {@code exo_controller_placeholder} view will be ignored.
* if this is set.
* <ul> * <ul>
* <li>Type: {@link View}</li> * <li>Type: {@link PlaybackControlView}</li>
* </ul> * </ul>
* </li> * </li>
* <li><b>{@code exo_overlay}</b> - A {@link FrameLayout} positioned on top of the player which * <li><b>{@code exo_overlay}</b> - A {@link FrameLayout} positioned on top of the player which