return( 0 ); /* out of bound */
}
}
- return( MP4_SeekStream( p_stream, p_box->i_size + p_box->i_pos ) ? 0 : 1 );
+ if( MP4_SeekStream( p_stream, p_box->i_size + p_box->i_pos ) )
+ {
+ return 0;
+ }
+
+ return 1;
}
/*****************************************************************************
FREE( p_box->data.p_sample_vide->p_qt_image_description );
}
+static int MP4_ReadBox_sample_mp4s( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
+{
+ MP4_SeekStream( p_stream, p_box->i_pos + MP4_BOX_HEADERSIZE( p_box ) + 8 );
+ MP4_ReadBoxContainerRaw( p_stream, p_box );
+ return 1;
+}
static int MP4_ReadBox_sample_text( MP4_Stream_t *p_stream, MP4_Box_t *p_box )
{
{ FOURCC_jpeg, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
{ FOURCC_avc1, MP4_ReadBox_sample_vide, MP4_FreeBox_sample_vide },
- { FOURCC_mp4s, MP4_ReadBox_default, MP4_FreeBox_Common },
+ { FOURCC_mp4s, MP4_ReadBox_sample_mp4s, MP4_FreeBox_Common },
/* XXX there is 2 box where we could find this entry stbl and tref*/
{ FOURCC_hint, MP4_ReadBox_default, MP4_FreeBox_Common },
#define FOURCC_priv VLC_FOURCC( 'p', 'r', 'i', 'v' )
#define FOURCC_text VLC_FOURCC( 't', 'e', 'x', 't' )
+#define FOURCC_subp VLC_FOURCC( 's', 'u', 'b', 'p' )
#define FOURCC_0xa9nam VLC_FOURCC( 0xa9, 'n', 'a', 'm' )
#define FOURCC_0xa9aut VLC_FOURCC( 0xa9, 'a', 'u', 't' )
(uint32_t*)p_block->p_buffer,
p_block->i_buffer );
}
- else if( tk->fmt.i_cat == SPU_ES && p_block->i_buffer >= 2 )
+ else if( tk->fmt.i_cat == SPU_ES )
{
- uint16_t i_size = GetWBE( p_block->p_buffer );
-
- if( i_size + 2 <= p_block->i_buffer )
+ if( tk->fmt.i_codec == VLC_FOURCC( 's', 'u', 'b', 't' ) && p_block->i_buffer >= 2 )
{
- char *p;
- /* remove the length field, and append a '\0' */
- memmove( &p_block->p_buffer[0], &p_block->p_buffer[2], i_size );
- p_block->p_buffer[i_size] = '\0';
- p_block->i_buffer = i_size + 1;
-
- /* convert \r -> \n */
- while( ( p = strchr( p_block->p_buffer, '\r' ) ) )
+ uint16_t i_size = GetWBE( p_block->p_buffer );
+
+ if( i_size + 2 <= p_block->i_buffer )
{
- *p = '\n';
+ char *p;
+ /* remove the length field, and append a '\0' */
+ memmove( &p_block->p_buffer[0], &p_block->p_buffer[2], i_size );
+ p_block->p_buffer[i_size] = '\0';
+ p_block->i_buffer = i_size + 1;
+
+ /* convert \r -> \n */
+ while( ( p = strchr( p_block->p_buffer, '\r' ) ) )
+ {
+ *p = '\n';
+ }
+ }
+ else
+ {
+ /* Invalid */
+ p_block->i_buffer = 0;
}
- }
- else
- {
- /* Invalid */
- p_block->i_buffer = 0;
}
}
p_block->i_dts = MP4_TrackGetPTS( p_demux, tk ) + 1;
+ fprintf( stderr, "dts=%lld\n", p_block->i_dts );
p_block->i_pts = tk->fmt.i_cat == VIDEO_ES ? 0 : p_block->i_dts + 1;
return VLC_SUCCESS;
}
+ case DEMUX_GET_TITLE_INFO:
+ case DEMUX_SET_NEXT_DEMUX_TIME:
+ case DEMUX_SET_GROUP:
+ return VLC_EGENERIC;
+
default:
- msg_Err( p_demux, "control query unimplemented !!!" );
+ msg_Warn( p_demux, "control query unimplemented !!!" );
return VLC_EGENERIC;
}
}
p_sample = MP4_BoxGet( p_track->p_stsd, "[%d]",
p_track->chunk[i_chunk].i_sample_description_index - 1 );
- if( !p_sample || !p_sample->data.p_data )
+ if( !p_sample || ( !p_sample->data.p_data && p_track->fmt.i_cat != SPU_ES ) )
{
msg_Warn( p_demux,
"cannot find SampleEntry (track[Id 0x%x])",
p_track->p_sample = p_sample;
- if( p_track->i_sample_size == 1 )
+ if( p_track->fmt.i_cat == AUDIO_ES && p_track->i_sample_size == 1 )
{
MP4_Box_data_sample_soun_t *p_soun;
case( 0x6c ): /* jpeg */
p_track->fmt.i_codec = VLC_FOURCC( 'j','p','e','g' );
break;
+
+ /* Private ID */
+ case( 0xe0 ): /* NeroDigital: dvd subs */
+ if( p_track->fmt.i_cat == SPU_ES )
+ {
+ p_track->fmt.i_codec = VLC_FOURCC( 's','p','u',' ' );
+ break;
+ }
+ /* Fallback */
default:
/* Unknown entry, but don't touch i_fourcc */
msg_Warn( p_demux,
break;
case( FOURCC_text ):
+ case( FOURCC_subp ):
p_track->fmt.i_cat = SPU_ES;
break;