Changeset 130 for smplayer/vendor/current/src/core.cpp
- Timestamp:
- Apr 30, 2012, 7:09:25 PM (14 years ago)
- File:
-
- 1 edited
-
smplayer/vendor/current/src/core.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
smplayer/vendor/current/src/core.cpp
r127 r130 784 784 785 785 #ifdef YOUTUBE_SUPPORT 786 if (name.contains("youtube.com/watch", Qt::CaseInsensitive)) { 786 if (name.contains("youtube.com/watch", Qt::CaseInsensitive) || 787 name.contains("youtu.be/", Qt::CaseInsensitive) || 788 name.contains("y2u.be/", Qt::CaseInsensitive) ) 789 { 787 790 qDebug("Core::openStream: youtube url detected"); 788 791 if (name.startsWith("www.youtube.com")) name = "http://" + name; 789 792 if (name.startsWith("youtube.com")) name = "http://www." + name; 793 794 790 795 yt->setPreferredQuality( (RetrieveYoutubeUrl::Quality) pref->yt_quality ); 791 796 yt->fetchPage(name); … … 3453 3458 qDebug("Core::changeChapter: ID: %d", ID); 3454 3459 3455 if (ID != mset.current_chapter_id) { 3456 //if (QFileInfo(mdat.filename).extension().lower()=="mkv") { 3457 if (mdat.type != TYPE_DVD) { 3460 if (mdat.type != TYPE_DVD) { 3461 /* 3462 if (mdat.chapters.find(ID) > -1) { 3463 double start = mdat.chapters.item(ID).start(); 3464 qDebug("Core::changeChapter: start: %f", start); 3465 goToSec(start); 3466 mset.current_chapter_id = ID; 3467 } else { 3468 */ 3469 tellmp("seek_chapter " + QString::number(ID) +" 1"); 3470 mset.current_chapter_id = ID; 3471 //updateWidgets(); 3472 /* 3473 } 3474 */ 3475 } else { 3476 #if SMART_DVD_CHAPTERS 3477 if (pref->cache_for_dvds == 0) { 3478 #else 3479 if (pref->fast_chapter_change) { 3480 #endif 3458 3481 tellmp("seek_chapter " + QString::number(ID) +" 1"); 3459 3482 mset.current_chapter_id = ID; 3460 3483 updateWidgets(); 3461 3484 } else { 3462 #if SMART_DVD_CHAPTERS 3463 if (pref->cache_for_dvds == 0) { 3464 #else 3465 if (pref->fast_chapter_change) { 3466 #endif 3467 tellmp("seek_chapter " + QString::number(ID) +" 1"); 3468 mset.current_chapter_id = ID; 3469 updateWidgets(); 3470 } else { 3471 stopMplayer(); 3472 mset.current_chapter_id = ID; 3473 //goToPos(0); 3474 mset.current_sec = 0; 3475 restartPlay(); 3476 } 3485 stopMplayer(); 3486 mset.current_chapter_id = ID; 3487 //goToPos(0); 3488 mset.current_sec = 0; 3489 restartPlay(); 3477 3490 } 3478 3491 } … … 3493 3506 int first_chapter = firstChapter(); 3494 3507 3495 last_chapter = mdat.n_chapters + firstChapter() - 1; 3496 3497 int ID = mset.current_chapter_id - 1; 3498 if (ID < first_chapter) { 3499 ID = last_chapter; 3500 } 3508 int ID = mdat.chapters.itemBeforeTime(mset.current_sec).ID(); 3509 3510 if (ID == -1) { 3511 last_chapter = mdat.n_chapters + firstChapter() - 1; 3512 3513 ID = mset.current_chapter_id - 1; 3514 if (ID < first_chapter) { 3515 ID = last_chapter; 3516 } 3517 } 3518 3501 3519 changeChapter(ID); 3502 3520 } … … 3505 3523 qDebug("Core::nextChapter"); 3506 3524 3507 int last_chapter = 0; 3508 last_chapter = mdat.n_chapters + firstChapter() - 1; 3509 3510 int ID = mset.current_chapter_id + 1; 3511 if (ID > last_chapter) { 3512 ID = firstChapter(); 3513 } 3525 int last_chapter = mdat.n_chapters + firstChapter() - 1; 3526 3527 int ID = mdat.chapters.itemAfterTime(mset.current_sec).ID(); 3528 3529 if (ID == -1) { 3530 ID = mset.current_chapter_id + 1; 3531 if (ID > last_chapter) { 3532 ID = firstChapter(); 3533 } 3534 } 3535 3514 3536 changeChapter(ID); 3515 3537 }
Note:
See TracChangeset
for help on using the changeset viewer.
