Commit 0ce68cce authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

* mtime_t != int This was causing incorrect results on big endian.

  Changed playlist_SetDuration.
* changed SORT_NORMAL SORT_REVERSE into ORDER_NORMAL ORDER_REVERSE
parent 5caa4176
/*****************************************************************************
* vlc_playlist.h : Playlist functions
*****************************************************************************
* Copyright (C) 1999, 2000, 2001, 2002 VideoLAN
* $Id: vlc_playlist.h,v 1.21 2004/01/06 08:50:20 zorglub Exp $
* Copyright (C) 1999-2004 VideoLAN
* $Id: vlc_playlist.h,v 1.22 2004/01/10 03:36:03 hartman Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -127,9 +127,10 @@ struct playlist_t
#define SORT_AUTHOR 1
#define SORT_GROUP 2
#define SORT_RANDOM 3
#define SORT_ID 4
#define SORT_NORMAL 0
#define SORT_REVERSE 1
#define ORDER_NORMAL 0
#define ORDER_REVERSE 1
#define PLAYLIST_TYPE_MANUAL 1
#define PLAYLIST_TYPE_SAP 2
......@@ -167,7 +168,7 @@ VLC_EXPORT( int, playlist_EnableGroup, ( playlist_t *, int ) );
/* Basic item informations accessors */
VLC_EXPORT( int, playlist_SetGroup, (playlist_t *, int, int ) );
VLC_EXPORT( int, playlist_SetName, (playlist_t *, int, char * ) );
VLC_EXPORT( int, playlist_SetDuration, (playlist_t *, int, int ) );
VLC_EXPORT( int, playlist_SetDuration, (playlist_t *, int, mtime_t ) );
/* Item search functions */
VLC_EXPORT( int, playlist_GetPositionById, (playlist_t *, int) );
......
/*****************************************************************************
* http.c : http mini-server ;)
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: http.c,v 1.42 2004/01/05 13:07:02 zorglub Exp $
* Copyright (C) 2001-2004 VideoLAN
* $Id: http.c,v 1.43 2004/01/10 03:36:03 hartman Exp $
*
* Authors: Gildas Bazin <gbazin@netcourrier.com>
* Laurent Aimar <fenrir@via.ecp.fr>
......@@ -1864,8 +1864,8 @@ static void MacroDo( httpd_file_callback_args_t *p_args,
uri_extract_value( p_request, "type", type, 12 );
uri_extract_value( p_request, "order", order, 2 );
if( order[0] == '0' ) i_order = SORT_NORMAL;
else i_order = SORT_REVERSE;
if( order[0] == '0' ) i_order = ORDER_NORMAL;
else i_order = ORDER_REVERSE;
if( !strcmp( type , "title" ) )
{
......
/*****************************************************************************
* ncurses.c : NCurses plugin for vlc
*****************************************************************************
* Copyright (C) 2001, 2002, 2003 VideoLAN
* $Id: ncurses.c,v 1.7 2004/01/08 16:28:37 fenrir Exp $
* Copyright (C) 2001-2004 VideoLAN
* $Id: ncurses.c,v 1.8 2004/01/10 03:36:03 hartman Exp $
*
* Authors: Sam Hocevar <sam@zoy.org>
* Laurent Aimar <fenrir@via.ecp.fr>
......@@ -265,13 +265,13 @@ static int HandleKey( intf_thread_t *p_intf, int i_key )
{
/* Playlist sort */
case 'r':
playlist_Sort( p_sys->p_playlist, SORT_RANDOM, SORT_NORMAL );
playlist_Sort( p_sys->p_playlist, SORT_RANDOM, ORDER_NORMAL );
return 1;
case 'o':
playlist_Sort( p_sys->p_playlist, SORT_TITLE, SORT_NORMAL );
playlist_Sort( p_sys->p_playlist, SORT_TITLE, ORDER_NORMAL );
return 1;
case 'O':
playlist_Sort( p_sys->p_playlist, SORT_TITLE, SORT_REVERSE );
playlist_Sort( p_sys->p_playlist, SORT_TITLE, ORDER_REVERSE );
return 1;
/* Playlist navigation */
......
......@@ -2,7 +2,7 @@
* cmd_playlist.cpp
*****************************************************************************
* Copyright (C) 2003 VideoLAN
* $Id: cmd_playlist.cpp,v 1.1 2004/01/03 23:31:33 asmax Exp $
* $Id: cmd_playlist.cpp,v 1.2 2004/01/10 03:36:03 hartman Exp $
*
* Authors: Cyril Deguet <asmax@via.ecp.fr>
* Olivier Teulire <ipkiss@via.ecp.fr>
......@@ -37,7 +37,7 @@ void CmdPlaylistSort::execute()
playlist_t *pPlaylist = getIntf()->p_sys->p_playlist;
if( pPlaylist != NULL )
{
playlist_Sort( pPlaylist, SORT_TITLE, SORT_NORMAL );
playlist_Sort( pPlaylist, SORT_TITLE, ORDER_NORMAL );
}
}
......
/*****************************************************************************
* playlist.cpp : wxWindows plugin for vlc
*****************************************************************************
* Copyright (C) 2000-2001, 2003 VideoLAN
* $Id: playlist.cpp,v 1.34 2004/01/08 00:52:08 sigmunau Exp $
* Copyright (C) 2000-2004 VideoLAN
* $Id: playlist.cpp,v 1.35 2004/01/10 03:36:03 hartman Exp $
*
* Authors: Olivier Teulire <ipkiss@via.ecp.fr>
*
......@@ -722,7 +722,7 @@ void Playlist::OnSort( wxCommandEvent& event )
playlist_SortGroup( p_playlist , 1 );
break;
case Randomize_Event:
playlist_Sort( p_playlist , SORT_RANDOM, SORT_NORMAL );
playlist_Sort( p_playlist , SORT_RANDOM, ORDER_NORMAL );
break;
}
vlc_object_release( p_playlist );
......
......@@ -2,7 +2,7 @@
* item-ext.c : Exported playlist item functions
*****************************************************************************
* Copyright (C) 1999-2004 VideoLAN
* $Id: item-ext.c,v 1.5 2004/01/07 19:20:30 gbazin Exp $
* $Id: item-ext.c,v 1.6 2004/01/10 03:36:03 hartman Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
* Clment Stenac <zorglub@videolan.org>
......@@ -233,7 +233,7 @@ int playlist_SetName( playlist_t *p_playlist, int i_item, char *psz_name )
* \param i_duration the duration to set
* \return VLC_SUCCESS on success, VLC_EGENERIC on failure
*/
int playlist_SetDuration( playlist_t *p_playlist, int i_item, int i_duration )
int playlist_SetDuration( playlist_t *p_playlist, int i_item, mtime_t i_duration )
{
char psz_buffer[MSTRTIME_MAX_SIZE];
vlc_value_t val;
......
......@@ -2,7 +2,7 @@
* sort.c : Playlist sorting functions
*****************************************************************************
* Copyright (C) 1999-2004 VideoLAN
* $Id: sort.c,v 1.5 2004/01/06 08:50:20 zorglub Exp $
* $Id: sort.c,v 1.6 2004/01/10 03:36:03 hartman Exp $
*
* Authors: Clment Stenac <zorglub@videolan.org>
*
......@@ -33,8 +33,8 @@
/**
* Sort the playlist
* \param p_playlist the playlist
* \param i_mode: SORT_TITLE, SORT_GROUP, SORT_AUTHOR, SORT_RANDOM
* \param i_type: SORT_NORMAL or SORT_REVERSE (reversed order)
* \param i_mode: SORT_TITLE, SORT_GROUP, SORT_AUTHOR, SORT_RANDOM SORT_ID
* \param i_type: ORDER_NORMAL or ORDER_REVERSE (reversed order)
* \return 0 on success
*/
int playlist_Sort( playlist_t * p_playlist , int i_mode, int i_type )
......@@ -96,8 +96,8 @@ int playlist_Sort( playlist_t * p_playlist , int i_mode, int i_type )
_("General") , _("Author") ) );
}
if( ( i_type == SORT_NORMAL && i_test < 0 ) ||
( i_type == SORT_REVERSE && i_test > 0 ) )
if( ( i_type == ORDER_NORMAL && i_test < 0 ) ||
( i_type == ORDER_REVERSE && i_test > 0 ) )
{
i_small = i;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment