[vlc-commits] demux: avi: refactor block output code
Francois Cartegnie
git at videolan.org
Mon Jul 8 16:32:53 CEST 2019
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Jul 8 14:00:50 2019 +0200| [fc77024ebbb318e2d6ac8ef91626de2dcbb31fa6] | committer: Francois Cartegnie
demux: avi: refactor block output code
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=fc77024ebbb318e2d6ac8ef91626de2dcbb31fa6
---
modules/demux/avi/avi.c | 66 ++++++++++++++++++++++---------------------------
1 file changed, 30 insertions(+), 36 deletions(-)
diff --git a/modules/demux/avi/avi.c b/modules/demux/avi/avi.c
index 50dc903852..2dfe4f4ff5 100644
--- a/modules/demux/avi/avi.c
+++ b/modules/demux/avi/avi.c
@@ -883,6 +883,34 @@ static block_t * ReadFrame( demux_t *p_demux, const avi_track_t *tk,
}
/*****************************************************************************
+ * SendFrame: Sends frame to ES and does payload processing
+ *****************************************************************************/
+static void AVI_SendFrame( demux_t *p_demux, avi_track_t *tk, block_t *p_frame )
+{
+ if( tk->fmt.i_cat != VIDEO_ES )
+ p_frame->i_dts = p_frame->i_pts;
+ else
+ {
+ p_frame->i_dts = p_frame->i_pts;
+ p_frame->i_pts = VLC_TICK_INVALID;
+ }
+
+ if( tk->i_dv_audio_rate )
+ AVI_DvHandleAudio( p_demux, tk, p_frame );
+
+ if( tk->i_next_block_flags )
+ {
+ p_frame->i_flags = tk->i_next_block_flags;
+ tk->i_next_block_flags = 0;
+ }
+
+ if( tk->p_es )
+ es_out_Send( p_demux->out, tk->p_es, p_frame );
+ else
+ block_Release( p_frame );
+}
+
+/*****************************************************************************
* Demux_Seekable: reads and demuxes data packets for stream seekable
*****************************************************************************
* AVIDemux: reads and demuxes data packets
@@ -1223,27 +1251,7 @@ static int Demux_Seekable( demux_t *p_demux )
toread[i_track].i_posf = -1;
}
- if( tk->fmt.i_cat != VIDEO_ES )
- p_frame->i_dts = p_frame->i_pts;
- else
- {
- p_frame->i_dts = p_frame->i_pts;
- p_frame->i_pts = VLC_TICK_INVALID;
- }
-
- if( tk->i_dv_audio_rate )
- AVI_DvHandleAudio( p_demux, tk, p_frame );
-
- if( tk->i_next_block_flags )
- {
- p_frame->i_flags = tk->i_next_block_flags;
- tk->i_next_block_flags = 0;
- }
-
- if( tk->p_es )
- es_out_Send( p_demux->out, tk->p_es, p_frame );
- else
- block_Release( p_frame );
+ AVI_SendFrame( p_demux, tk, p_frame );
}
}
@@ -1361,21 +1369,7 @@ static int Demux_UnSeekable( demux_t *p_demux )
}
p_frame->i_pts = VLC_TICK_0 + AVI_GetPTS( p_stream );
- if( avi_pk.i_cat != VIDEO_ES )
- p_frame->i_dts = p_frame->i_pts;
- else
- {
- p_frame->i_dts = p_frame->i_pts;
- p_frame->i_pts = VLC_TICK_INVALID;
- }
-
- if( p_stream->i_dv_audio_rate )
- AVI_DvHandleAudio( p_demux, p_stream, p_frame );
-
- if( p_stream->p_es )
- es_out_Send( p_demux->out, p_stream->p_es, p_frame );
- else
- block_Release( p_frame );
+ AVI_SendFrame( p_demux, p_stream, p_frame );
}
else
{
More information about the vlc-commits
mailing list