Mercurial > mplayer.hg
comparison mplayer.c @ 33287:3105428bb2ae
Doxygen cleanups in the main file.
This patch include various cleanups:
- remove old unecessary cruft
- consistent Doxygen comments ('@' everywhere instead of '\')
- various /// changed into standard comments or description aside the
attribute
- various small typo fixes
author | cboesch |
---|---|
date | Thu, 05 May 2011 10:29:08 +0000 |
parents | af44c90c8473 |
children | 00a8d85deb92 |
comparison
equal
deleted
inserted
replaced
33286:6e8013170a94 | 33287:3105428bb2ae |
---|---|
13 * | 13 * |
14 * You should have received a copy of the GNU General Public License along | 14 * You should have received a copy of the GNU General Public License along |
15 * with MPlayer; if not, write to the Free Software Foundation, Inc., | 15 * with MPlayer; if not, write to the Free Software Foundation, Inc., |
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | 16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
17 */ | 17 */ |
18 | |
19 /// \file | |
20 /// \ingroup Properties Command2Property OSDMsgStack | |
21 | 18 |
22 #include "config.h" | 19 #include "config.h" |
23 | 20 |
24 #include <errno.h> | 21 #include <errno.h> |
25 #include <fcntl.h> | 22 #include <fcntl.h> |
337 int use_filedir_conf; | 334 int use_filedir_conf; |
338 int use_filename_title; | 335 int use_filename_title; |
339 | 336 |
340 static unsigned int initialized_flags; | 337 static unsigned int initialized_flags; |
341 | 338 |
342 /// step size of mixer changes | 339 int volstep = 3; ///< step size of mixer changes |
343 int volstep = 3; | |
344 | 340 |
345 #ifdef CONFIG_CRASH_DEBUG | 341 #ifdef CONFIG_CRASH_DEBUG |
346 static char *prog_path; | 342 static char *prog_path; |
347 static int crash_debug; | 343 static int crash_debug; |
348 #endif | 344 #endif |
947 m_config_set_profile(conf,p); | 943 m_config_set_profile(conf,p); |
948 } | 944 } |
949 } | 945 } |
950 | 946 |
951 /** | 947 /** |
952 * Tries to load a config file | 948 * @brief Tries to load a config file. |
953 * @return 0 if file was not found, 1 otherwise | 949 * @return 0 if file was not found, 1 otherwise |
954 */ | 950 */ |
955 static int try_load_config(m_config_t *conf, const char *file) | 951 static int try_load_config(m_config_t *conf, const char *file) |
956 { | 952 { |
957 struct stat st; | 953 struct stat st; |
1181 mp_property_do("sub_forced_only", M_PROPERTY_SET, &forced_subs_only, mpctx); | 1177 mp_property_do("sub_forced_only", M_PROPERTY_SET, &forced_subs_only, mpctx); |
1182 } | 1178 } |
1183 } | 1179 } |
1184 | 1180 |
1185 /** | 1181 /** |
1186 * \brief append a formatted string | 1182 * @brief Append a formatted string. |
1187 * \param buf buffer to print into | 1183 * @param buf buffer to print into |
1188 * \param pos position of terminating 0 in buf | 1184 * @param pos position of terminating 0 in buf |
1189 * \param len maximum number of characters in buf, not including terminating 0 | 1185 * @param len maximum number of characters in buf, not including terminating 0 |
1190 * \param format printf format string | 1186 * @param format printf format string |
1191 */ | 1187 */ |
1192 static void saddf(char *buf, unsigned *pos, int len, const char *format, ...) | 1188 static void saddf(char *buf, unsigned *pos, int len, const char *format, ...) |
1193 { | 1189 { |
1194 va_list va; | 1190 va_list va; |
1195 va_start(va, format); | 1191 va_start(va, format); |
1200 *pos = len; | 1196 *pos = len; |
1201 } | 1197 } |
1202 } | 1198 } |
1203 | 1199 |
1204 /** | 1200 /** |
1205 * \brief append time in the hh:mm:ss.f format | 1201 * @brief Append time in the hh:mm:ss.f format. |
1206 * \param buf buffer to print into | 1202 * @param buf buffer to print into |
1207 * \param pos position of terminating 0 in buf | 1203 * @param pos position of terminating 0 in buf |
1208 * \param len maximum number of characters in buf, not including terminating 0 | 1204 * @param len maximum number of characters in buf, not including terminating 0 |
1209 * \param time time value to convert/append | 1205 * @param time time value to convert/append |
1210 */ | 1206 */ |
1211 static void sadd_hhmmssf(char *buf, unsigned *pos, int len, float time) { | 1207 static void sadd_hhmmssf(char *buf, unsigned *pos, int len, float time) { |
1212 int64_t tenths = 10 * time; | 1208 int64_t tenths = 10 * time; |
1213 int f1 = tenths % 10; | 1209 int f1 = tenths % 10; |
1214 int ss = (tenths / 10) % 60; | 1210 int ss = (tenths / 10) % 60; |
1224 saddf(buf, pos, len, "%02d:", mm); | 1220 saddf(buf, pos, len, "%02d:", mm); |
1225 saddf(buf, pos, len, "%02d.%1d", ss, f1); | 1221 saddf(buf, pos, len, "%02d.%1d", ss, f1); |
1226 } | 1222 } |
1227 | 1223 |
1228 /** | 1224 /** |
1229 * \brief print the status line | 1225 * @brief Print the status line. |
1230 * \param a_pos audio position | 1226 * @param a_pos audio position |
1231 * \param a_v A-V desynchronization | 1227 * @param a_v A-V desynchronization |
1232 * \param corr amount out A-V synchronization | 1228 * @param corr amount out A-V synchronization |
1233 */ | 1229 */ |
1234 static void print_status(float a_pos, float a_v, float corr) | 1230 static void print_status(float a_pos, float a_v, float corr) |
1235 { | 1231 { |
1236 sh_video_t * const sh_video = mpctx->sh_video; | 1232 sh_video_t * const sh_video = mpctx->sh_video; |
1237 int width; | 1233 int width; |
1318 } | 1314 } |
1319 free(line); | 1315 free(line); |
1320 } | 1316 } |
1321 | 1317 |
1322 /** | 1318 /** |
1323 * \brief build a chain of audio filters that converts the input format | 1319 * @brief Build a chain of audio filters that converts the input format. |
1324 * to the ao's format, taking into account the current playback_speed. | 1320 * to the ao's format, taking into account the current playback_speed. |
1325 * \param sh_audio describes the requested input format of the chain. | 1321 * @param sh_audio describes the requested input format of the chain. |
1326 * \param ao_data describes the requested output format of the chain. | 1322 * @param ao_data describes the requested output format of the chain. |
1327 */ | 1323 */ |
1328 static int build_afilter_chain(sh_audio_t *sh_audio, ao_data_t *ao_data) | 1324 static int build_afilter_chain(sh_audio_t *sh_audio, ao_data_t *ao_data) |
1329 { | 1325 { |
1330 int new_srate; | 1326 int new_srate; |
1331 int result; | 1327 int result; |
1362 } | 1358 } |
1363 | 1359 |
1364 | 1360 |
1365 typedef struct mp_osd_msg mp_osd_msg_t; | 1361 typedef struct mp_osd_msg mp_osd_msg_t; |
1366 struct mp_osd_msg { | 1362 struct mp_osd_msg { |
1367 /// Previous message on the stack. | 1363 mp_osd_msg_t* prev; ///< Previous message on the stack |
1368 mp_osd_msg_t* prev; | 1364 char msg[128]; ///< Message text |
1369 /// Message text. | |
1370 char msg[128]; | |
1371 int id,level,started; | 1365 int id,level,started; |
1372 /// Display duration in ms. | 1366 unsigned time; ///< Display duration in ms |
1373 unsigned time; | |
1374 }; | 1367 }; |
1375 | 1368 |
1376 /// OSD message stack. | 1369 static mp_osd_msg_t* osd_msg_stack; ///< OSD message stack |
1377 static mp_osd_msg_t* osd_msg_stack; | |
1378 | 1370 |
1379 /** | 1371 /** |
1380 * \brief Add a message on the OSD message stack | 1372 * @brief Add a message on the OSD message stack. |
1381 * | 1373 * |
1382 * If a message with the same id is already present in the stack | 1374 * If a message with the same id is already present in the stack |
1383 * it is pulled on top of the stack, otherwise a new message is created. | 1375 * it is pulled on top of the stack, otherwise a new message is created. |
1384 * | |
1385 */ | 1376 */ |
1386 | |
1387 void set_osd_msg(int id, int level, int time, const char* fmt, ...) { | 1377 void set_osd_msg(int id, int level, int time, const char* fmt, ...) { |
1388 mp_osd_msg_t *msg,*last=NULL; | 1378 mp_osd_msg_t *msg,*last=NULL; |
1389 va_list va; | 1379 va_list va; |
1390 int r; | 1380 int r; |
1391 | 1381 |
1413 msg->time = time; | 1403 msg->time = time; |
1414 | 1404 |
1415 } | 1405 } |
1416 | 1406 |
1417 /** | 1407 /** |
1418 * \brief Remove a message from the OSD stack | 1408 * @brief Remove a message from the OSD stack. |
1419 * | 1409 * |
1420 * This function can be used to get rid of a message right away. | 1410 * This function can be used to get rid of a message right away. |
1421 * | |
1422 */ | 1411 */ |
1423 | |
1424 void rm_osd_msg(int id) { | 1412 void rm_osd_msg(int id) { |
1425 mp_osd_msg_t *msg,*last=NULL; | 1413 mp_osd_msg_t *msg,*last=NULL; |
1426 | 1414 |
1427 // Search for the msg | 1415 // Search for the msg |
1428 for(msg = osd_msg_stack ; msg && msg->id != id ; | 1416 for(msg = osd_msg_stack ; msg && msg->id != id ; |
1436 osd_msg_stack = msg->prev; | 1424 osd_msg_stack = msg->prev; |
1437 free(msg); | 1425 free(msg); |
1438 } | 1426 } |
1439 | 1427 |
1440 /** | 1428 /** |
1441 * \brief Remove all messages from the OSD stack | 1429 * @brief Remove all messages from the OSD stack. |
1442 * | |
1443 */ | 1430 */ |
1444 | |
1445 static void clear_osd_msgs(void) { | 1431 static void clear_osd_msgs(void) { |
1446 mp_osd_msg_t* msg = osd_msg_stack, *prev = NULL; | 1432 mp_osd_msg_t* msg = osd_msg_stack, *prev = NULL; |
1447 while(msg) { | 1433 while(msg) { |
1448 prev = msg->prev; | 1434 prev = msg->prev; |
1449 free(msg); | 1435 free(msg); |
1451 } | 1437 } |
1452 osd_msg_stack = NULL; | 1438 osd_msg_stack = NULL; |
1453 } | 1439 } |
1454 | 1440 |
1455 /** | 1441 /** |
1456 * \brief Get the current message from the OSD stack. | 1442 * @brief Get the current message from the OSD stack. |
1457 * | 1443 * |
1458 * This function decrements the message timer and destroys the old ones. | 1444 * This function decrements the message timer and destroys the old ones. |
1459 * The message that should be displayed is returned (if any). | 1445 * The message that should be displayed is returned (if any). |
1460 * | |
1461 */ | 1446 */ |
1462 | |
1463 static mp_osd_msg_t* get_osd_msg(void) { | 1447 static mp_osd_msg_t* get_osd_msg(void) { |
1464 mp_osd_msg_t *msg,*prev,*last = NULL; | 1448 mp_osd_msg_t *msg,*prev,*last = NULL; |
1465 static unsigned last_update; | 1449 static unsigned last_update; |
1466 unsigned now = GetTimerMS(); | 1450 unsigned now = GetTimerMS(); |
1467 unsigned diff; | 1451 unsigned diff; |
1511 // Nothing found | 1495 // Nothing found |
1512 return NULL; | 1496 return NULL; |
1513 } | 1497 } |
1514 | 1498 |
1515 /** | 1499 /** |
1516 * \brief Display the OSD bar. | 1500 * @brief Display the OSD bar. |
1517 * | 1501 * |
1518 * Display the OSD bar or fall back on a simple message. | 1502 * Display the OSD bar or fall back on a simple message. |
1519 * | |
1520 */ | 1503 */ |
1521 | |
1522 void set_osd_bar(int type,const char* name,double min,double max,double val) { | 1504 void set_osd_bar(int type,const char* name,double min,double max,double val) { |
1523 | 1505 |
1524 if(osd_level < 1) return; | 1506 if(osd_level < 1) return; |
1525 | 1507 |
1526 if(mpctx->sh_video) { | 1508 if(mpctx->sh_video) { |
1534 set_osd_msg(OSD_MSG_BAR,1,osd_duration,"%s: %d %%", | 1516 set_osd_msg(OSD_MSG_BAR,1,osd_duration,"%s: %d %%", |
1535 name,ROUND(100*(val-min)/(max-min))); | 1517 name,ROUND(100*(val-min)/(max-min))); |
1536 } | 1518 } |
1537 | 1519 |
1538 /** | 1520 /** |
1539 * \brief Display text subtitles on the OSD | 1521 * @brief Display text subtitles on the OSD. |
1540 */ | 1522 */ |
1541 void set_osd_subtitle(subtitle *subs) { | 1523 void set_osd_subtitle(subtitle *subs) { |
1542 int i; | 1524 int i; |
1543 vo_sub = subs; | 1525 vo_sub = subs; |
1544 vo_osd_changed(OSDTYPE_SUBTITLE); | 1526 vo_osd_changed(OSDTYPE_SUBTITLE); |
1555 } | 1537 } |
1556 } | 1538 } |
1557 } | 1539 } |
1558 | 1540 |
1559 /** | 1541 /** |
1560 * \brief Update the OSD message line. | 1542 * @brief Update the OSD message line. |
1561 * | 1543 * |
1562 * This function displays the current message on the vo OSD or on the term. | 1544 * This function displays the current message on the vo OSD or on the term. |
1563 * If the stack is empty and the OSD level is high enough the timer | 1545 * If the stack is empty and the OSD level is high enough the timer |
1564 * is displayed (only on the vo OSD). | 1546 * is displayed (only on the vo OSD). |
1565 * | |
1566 */ | 1547 */ |
1567 | |
1568 static void update_osd_msg(void) { | 1548 static void update_osd_msg(void) { |
1569 mp_osd_msg_t *msg; | 1549 mp_osd_msg_t *msg; |
1570 static char osd_text[128] = ""; | 1550 static char osd_text[128] = ""; |
1571 static char osd_text_timer[128]; | 1551 static char osd_text_timer[128]; |
1572 | 1552 |
1650 if(term_osd && osd_text[0]) { | 1630 if(term_osd && osd_text[0]) { |
1651 osd_text[0] = 0; | 1631 osd_text[0] = 0; |
1652 printf("%s\n",term_osd_esc); | 1632 printf("%s\n",term_osd_esc); |
1653 } | 1633 } |
1654 } | 1634 } |
1655 | |
1656 ///@} | |
1657 // OSDMsgStack | |
1658 | 1635 |
1659 | 1636 |
1660 void reinit_audio_chain(void) { | 1637 void reinit_audio_chain(void) { |
1661 if (!mpctx->sh_audio) | 1638 if (!mpctx->sh_audio) |
1662 return; | 1639 return; |
1722 mpctx->sh_audio=mpctx->d_audio->sh=NULL; // -> nosound | 1699 mpctx->sh_audio=mpctx->d_audio->sh=NULL; // -> nosound |
1723 mpctx->d_audio->id = -2; | 1700 mpctx->d_audio->id = -2; |
1724 } | 1701 } |
1725 | 1702 |
1726 | 1703 |
1727 ///@} | |
1728 // Command2Property | |
1729 | |
1730 | |
1731 // Return pts value corresponding to the end point of audio written to the | 1704 // Return pts value corresponding to the end point of audio written to the |
1732 // ao so far. | 1705 // ao so far. |
1733 static double written_audio_pts(sh_audio_t *sh_audio, demux_stream_t *d_audio) | 1706 static double written_audio_pts(sh_audio_t *sh_audio, demux_stream_t *d_audio) |
1734 { | 1707 { |
1735 double buffered_output; | 1708 double buffered_output; |
1904 | 1877 |
1905 #ifdef CONFIG_DVDNAV | 1878 #ifdef CONFIG_DVDNAV |
1906 #ifndef FF_B_TYPE | 1879 #ifndef FF_B_TYPE |
1907 #define FF_B_TYPE 3 | 1880 #define FF_B_TYPE 3 |
1908 #endif | 1881 #endif |
1909 /// store decoded video image | 1882 /** |
1883 * @brief Store decoded video image. | |
1884 */ | |
1910 static mp_image_t * mp_dvdnav_copy_mpi(mp_image_t *to_mpi, | 1885 static mp_image_t * mp_dvdnav_copy_mpi(mp_image_t *to_mpi, |
1911 mp_image_t *from_mpi) { | 1886 mp_image_t *from_mpi) { |
1912 mp_image_t *mpi; | 1887 mp_image_t *mpi; |
1913 | 1888 |
1914 /// Do not store B-frames | 1889 // do not store B-frames |
1915 if (from_mpi->pict_type == FF_B_TYPE) | 1890 if (from_mpi->pict_type == FF_B_TYPE) |
1916 return to_mpi; | 1891 return to_mpi; |
1917 | 1892 |
1918 if (to_mpi && | 1893 if (to_mpi && |
1919 to_mpi->w == from_mpi->w && | 1894 to_mpi->w == from_mpi->w && |
1932 return mpi; | 1907 return mpi; |
1933 } | 1908 } |
1934 | 1909 |
1935 static void mp_dvdnav_reset_stream (MPContext *ctx) { | 1910 static void mp_dvdnav_reset_stream (MPContext *ctx) { |
1936 if (ctx->sh_video) { | 1911 if (ctx->sh_video) { |
1937 /// clear video pts | 1912 // clear video pts |
1938 ctx->d_video->pts = 0.0f; | 1913 ctx->d_video->pts = 0.0f; |
1939 ctx->sh_video->pts = 0.0f; | 1914 ctx->sh_video->pts = 0.0f; |
1940 ctx->sh_video->i_pts = 0.0f; | 1915 ctx->sh_video->i_pts = 0.0f; |
1941 ctx->sh_video->last_pts = 0.0f; | 1916 ctx->sh_video->last_pts = 0.0f; |
1942 ctx->sh_video->num_buffered_pts = 0; | 1917 ctx->sh_video->num_buffered_pts = 0; |
1947 ctx->sh_video->timer = 0; | 1922 ctx->sh_video->timer = 0; |
1948 ctx->demuxer->stream_pts = MP_NOPTS_VALUE; | 1923 ctx->demuxer->stream_pts = MP_NOPTS_VALUE; |
1949 } | 1924 } |
1950 | 1925 |
1951 if (ctx->sh_audio) { | 1926 if (ctx->sh_audio) { |
1952 /// free audio packets and reset | 1927 // free audio packets and reset |
1953 ds_free_packs(ctx->d_audio); | 1928 ds_free_packs(ctx->d_audio); |
1954 audio_delay -= ctx->sh_audio->stream_delay; | 1929 audio_delay -= ctx->sh_audio->stream_delay; |
1955 ctx->delay =- audio_delay; | 1930 ctx->delay =- audio_delay; |
1956 ctx->audio_out->reset(); | 1931 ctx->audio_out->reset(); |
1957 resync_audio_stream(ctx->sh_audio); | 1932 resync_audio_stream(ctx->sh_audio); |
1965 dvdsub_id = dvdsub_lang_id; | 1940 dvdsub_id = dvdsub_lang_id; |
1966 select_subtitle(ctx); | 1941 select_subtitle(ctx); |
1967 } | 1942 } |
1968 } | 1943 } |
1969 | 1944 |
1970 /// clear all EOF related flags | 1945 // clear all EOF related flags |
1971 ctx->d_video->eof = ctx->d_audio->eof = ctx->stream->eof = 0; | 1946 ctx->d_video->eof = ctx->d_audio->eof = ctx->stream->eof = 0; |
1972 } | 1947 } |
1973 | 1948 |
1974 /// Restore last decoded DVDNAV (still frame) | 1949 /** |
1950 * @brief Restore last decoded DVDNAV (still frame). | |
1951 */ | |
1975 static mp_image_t *mp_dvdnav_restore_smpi(int *in_size, | 1952 static mp_image_t *mp_dvdnav_restore_smpi(int *in_size, |
1976 unsigned char **start, | 1953 unsigned char **start, |
1977 mp_image_t *decoded_frame) | 1954 mp_image_t *decoded_frame) |
1978 { | 1955 { |
1979 if (mpctx->stream->type != STREAMTYPE_DVDNAV) | 1956 if (mpctx->stream->type != STREAMTYPE_DVDNAV) |
1980 return decoded_frame; | 1957 return decoded_frame; |
1981 | 1958 |
1982 /// a change occured in dvdnav stream | 1959 // a change occured in dvdnav stream |
1983 if (mp_dvdnav_cell_has_changed(mpctx->stream,0)) { | 1960 if (mp_dvdnav_cell_has_changed(mpctx->stream,0)) { |
1984 mp_dvdnav_read_wait(mpctx->stream, 1, 1); | 1961 mp_dvdnav_read_wait(mpctx->stream, 1, 1); |
1985 mp_dvdnav_context_free(mpctx); | 1962 mp_dvdnav_context_free(mpctx); |
1986 mp_dvdnav_reset_stream(mpctx); | 1963 mp_dvdnav_reset_stream(mpctx); |
1987 mp_dvdnav_read_wait(mpctx->stream, 0, 1); | 1964 mp_dvdnav_read_wait(mpctx->stream, 0, 1); |
1989 } | 1966 } |
1990 | 1967 |
1991 if (*in_size < 0) { | 1968 if (*in_size < 0) { |
1992 float len; | 1969 float len; |
1993 | 1970 |
1994 /// Display still frame, if any | 1971 // display still frame, if any |
1995 if (mpctx->nav_smpi && !mpctx->nav_buffer) | 1972 if (mpctx->nav_smpi && !mpctx->nav_buffer) |
1996 decoded_frame = mpctx->nav_smpi; | 1973 decoded_frame = mpctx->nav_smpi; |
1997 | 1974 |
1998 /// increment video frame : continue playing after still frame | 1975 // increment video frame: continue playing after still frame |
1999 len = demuxer_get_time_length(mpctx->demuxer); | 1976 len = demuxer_get_time_length(mpctx->demuxer); |
2000 if (mpctx->sh_video->pts >= len && | 1977 if (mpctx->sh_video->pts >= len && |
2001 mpctx->sh_video->pts > 0.0 && len > 0.0) { | 1978 mpctx->sh_video->pts > 0.0 && len > 0.0) { |
2002 mp_dvdnav_skip_still(mpctx->stream); | 1979 mp_dvdnav_skip_still(mpctx->stream); |
2003 mp_dvdnav_skip_wait(mpctx->stream); | 1980 mp_dvdnav_skip_wait(mpctx->stream); |
2013 } | 1990 } |
2014 | 1991 |
2015 return decoded_frame; | 1992 return decoded_frame; |
2016 } | 1993 } |
2017 | 1994 |
2018 /// Save last decoded DVDNAV (still frame) | 1995 /** |
1996 * @brief Save last decoded DVDNAV (still frame). | |
1997 */ | |
2019 static void mp_dvdnav_save_smpi(int in_size, | 1998 static void mp_dvdnav_save_smpi(int in_size, |
2020 unsigned char *start, | 1999 unsigned char *start, |
2021 mp_image_t *decoded_frame) | 2000 mp_image_t *decoded_frame) |
2022 { | 2001 { |
2023 if (mpctx->stream->type != STREAMTYPE_DVDNAV) | 2002 if (mpctx->stream->type != STREAMTYPE_DVDNAV) |
2397 current_module = "video_read_frame"; | 2376 current_module = "video_read_frame"; |
2398 frame_time = sh_video->next_frame_time; | 2377 frame_time = sh_video->next_frame_time; |
2399 in_size = video_read_frame(sh_video, &sh_video->next_frame_time, | 2378 in_size = video_read_frame(sh_video, &sh_video->next_frame_time, |
2400 &start, force_fps); | 2379 &start, force_fps); |
2401 #ifdef CONFIG_DVDNAV | 2380 #ifdef CONFIG_DVDNAV |
2402 /// wait, still frame or EOF | 2381 // wait, still frame or EOF |
2403 if (mpctx->stream->type == STREAMTYPE_DVDNAV && in_size < 0) { | 2382 if (mpctx->stream->type == STREAMTYPE_DVDNAV && in_size < 0) { |
2404 if (mp_dvdnav_is_eof(mpctx->stream)) | 2383 if (mp_dvdnav_is_eof(mpctx->stream)) |
2405 return -1; | 2384 return -1; |
2406 if (mpctx->d_video) | 2385 if (mpctx->d_video) |
2407 mpctx->d_video->eof = 0; | 2386 mpctx->d_video->eof = 0; |
2417 drop_frame = check_framedrop(frame_time); | 2396 drop_frame = check_framedrop(frame_time); |
2418 current_module = "decode_video"; | 2397 current_module = "decode_video"; |
2419 #ifdef CONFIG_DVDNAV | 2398 #ifdef CONFIG_DVDNAV |
2420 full_frame = 1; | 2399 full_frame = 1; |
2421 decoded_frame = mp_dvdnav_restore_smpi(&in_size,&start,decoded_frame); | 2400 decoded_frame = mp_dvdnav_restore_smpi(&in_size,&start,decoded_frame); |
2422 /// still frame has been reached, no need to decode | 2401 // still frame has been reached, no need to decode |
2423 if (in_size > 0 && !decoded_frame) | 2402 if (in_size > 0 && !decoded_frame) |
2424 #endif | 2403 #endif |
2425 decoded_frame = decode_video(sh_video, start, in_size, drop_frame, | 2404 decoded_frame = decode_video(sh_video, start, in_size, drop_frame, |
2426 sh_video->pts, &full_frame); | 2405 sh_video->pts, &full_frame); |
2427 | 2406 |
2457 update_subtitles(sh_video, sh_video->pts, mpctx->d_sub, 0); | 2436 update_subtitles(sh_video, sh_video->pts, mpctx->d_sub, 0); |
2458 update_teletext(sh_video, mpctx->demuxer, 0); | 2437 update_teletext(sh_video, mpctx->demuxer, 0); |
2459 update_osd_msg(); | 2438 update_osd_msg(); |
2460 } | 2439 } |
2461 #ifdef CONFIG_DVDNAV | 2440 #ifdef CONFIG_DVDNAV |
2462 /// save back last still frame for future display | 2441 // save back last still frame for future display |
2463 mp_dvdnav_save_smpi(in_size,start,decoded_frame); | 2442 mp_dvdnav_save_smpi(in_size,start,decoded_frame); |
2464 #endif | 2443 #endif |
2465 } while (!full_frame); | 2444 } while (!full_frame); |
2466 | 2445 |
2467 current_module = "filter_video"; | 2446 current_module = "filter_video"; |
3002 #endif | 2981 #endif |
3003 | 2982 |
3004 initialized_flags|=INITIALIZED_INPUT; | 2983 initialized_flags|=INITIALIZED_INPUT; |
3005 current_module = NULL; | 2984 current_module = NULL; |
3006 | 2985 |
3007 /// Catch signals | 2986 // Catch signals |
3008 #ifndef __MINGW32__ | 2987 #ifndef __MINGW32__ |
3009 signal(SIGCHLD,child_sighandler); | 2988 signal(SIGCHLD,child_sighandler); |
3010 #endif | 2989 #endif |
3011 | 2990 |
3012 #ifdef CONFIG_CRASH_DEBUG | 2991 #ifdef CONFIG_CRASH_DEBUG |